title: PHP "Json Format Error" on Azure Cognitive Services
body: <p>I'm trying to use the Azure OCR Service to get the text of an image back.
  Unfortunately I'm always getting this error:</p>
  
  <blockquote>
    <p>{"code":"BadArgument","requestId":"49cecd3b-7be3-4aaa-9a5e-fXXXXXXXXXXX","message":"JSON format error."}</p>
  </blockquote>
  
  <p>My code is:</p>
  
  <pre><code>&lt;?php
  
  (http://hc.apache.org/httpcomponents-client-ga/)
  require_once 'HTTP/Request2.php';
  
  $request = new Http_Request2('https://westcentralus.api.cognitive.microsoft.com/vision/v1.0/ocr'); 
  $url = $request-&gt;getUrl();
  
  $headers = array(
  
      'Content-Type' =&gt; 'application/json',
  
      'Ocp-Apim-Subscription-Key' =&gt; 'c7b9e7ab25b14XXXXXXXXXXXXXXXXXX',
  );
  
  
  $request-&gt;setHeader($headers);
  
  $parameters = array(
  
      'language' =&gt; 'unk',
      'detectOrientation ' =&gt; 'true',
  );
  
  $url-&gt;setQueryVariables($parameters);
  
  $request-&gt;setMethod(HTTP_Request2::METHOD_POST);
  
  
  $request-&gt;setBody("https://image.spreadshirtmedia.net/image-server/v1/mp/compositions/P116103877MPC131734766/views/1,width=300,height=300,appearanceId=1,backgroundColor=E8E8E8,version=1472099537/hallo-sprechblase-auf-babybauch-oder-babyshirt-t-shirts-maenner-premium-t-shirt.jpg");  
  
  try
  {
      $response = $request-&gt;send();
      echo $response-&gt;getBody();  
  
  }
  catch (HttpException $ex)
  {
      echo "Fehler :(";
      echo $ex;
  }
  ?&gt;
  </code></pre>