title: Can't send json message to AWS SQS from cURL POST
body: <p>I have the AWS SDK for PHP installed in the webserver and can create a queue, send/delete a test message. I then tried to check if I can send a json (text or object) from using curl. Somehow it's not getting the message. If I change the variable ($json) in the 'MessageBody' to a string and run the php script manually, the string gets forwarded to the queue. Any ideas?</p>
  
  <pre><code>&lt;?php
  
  require 'SQS/aws-autoloader.php';
  use Aws\Sqs\SqsClient;
  use Aws\Exception\AwsException;
  
  header("Content-Type: application/json");
  
  $json = file_get_contents('php://input');
  error_log( print_r( $json, true ));
  
  $client = new SqsClient([
  'profile' =&gt; 'default',
  'region' =&gt; 'us-east-1',
  'version' =&gt; 'latest'
  ]);
  
  $client-&gt;sendMessage(array(
  'QueueUrl'    =&gt; "https://sqs.us-east-1.amazonaws.com/xxxxxxxxxx/xxxxxxxxxx",
  'MessageBody' =&gt; $json
  ));
  </code></pre>
  
  <p>Here is the cURL request:</p>
  
  <p>curl -v <a href="http://xx.xxx.xxx.xxx/somesite/somescript.php" rel="nofollow noreferrer">http://xx.xxx.xxx.xxx/somesite/somescript.php</a> -d '{"hello":"world"}' -H "Content-Type: application/json"</p>