title: Guzzle and Unable to parse response into JSON
body: <p>I have a little php api client with this method:</p>
  
  <pre><code>private function send($endpoint)
  {
      $headers = array();
      $body = $this-&gt;xmlSerialiser-&gt;convertToXML($this-&gt;getQueue());
  
      try {
          $response = json_decode(
              $this-&gt;guzzleClient-&gt;post(
                  $endpoint,
                  $headers, $body
              )
              -&gt;send()
              -&gt;json()
          );
  
      } catch (\Guzzle\Http\Exception\BadResponseException $e) {
          $response = array('Error' =&gt; $e-&gt;getMessage());
      }
  
      return $response;
  }
  </code></pre>
  
  <p>I'm always receiving </p>
  
  <pre><code>Unable to parse response body into JSON: 4 (500 Internal Server Error)
  </code></pre>
  
  <p>I already tried to know an example of server response and seems to be fine:</p>
  
  <pre><code>echo (string) $this-&gt;guzzleClient-&gt;post(
                  $endpoint,
                  $headers, $body
              )
              -&gt;send()-&gt;getBody();
  </code></pre>
  
  <p>and this is the result:</p>
  
  <pre><code>&lt;Messages xmlns="http://www.example.com/xxx/3.0"&gt;
  
  &lt;GetAccountResponse RequestType="GetAccount"&gt;
  
      &lt;AccountId&gt;xxxx-xxx-xxx-xxxx-xxxx&lt;/AccountId&gt;
  
      &lt;Token&gt;xxxxxxxxxxxxxx/t3VkEJXC7f6b6G4yPJSZ5QfT2hdSQXUmi0e8cndSYLK4N7mswRHifzwGHLUJYHM17iGL8s=&lt;/Token&gt;
  
  &lt;/GetAccountResponse&gt;
  </code></pre>
  
  <p></p>