title: Unexpected $response from Guzzle HTTP GET from external API with Symfony 3 project
body: <p>I am using <a href="http://docs.guzzlephp.org/en/latest/index.html" rel="nofollow noreferrer">Guzzle</a> to perform a HTTP GET request from an external API in my <a href="http://symfony.com/" rel="nofollow noreferrer">Symfony 3</a> project. Here is my Controller code:</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Controller;
  
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Symfony\Component\HttpFoundation\Response;
  use Symfony\Component\HttpFoundation\Request;
  use Psr\Http\Message\ResponseInterface;
  use GuzzleHttp\Client;
  
  class ScheduleController extends Controller {
  
  /**
   * @Route("/schedule")
   */
  
  public function getJobs() {
      // Create a client with a base URI
      $client = new \GuzzleHttp\Client(['base_uri' =&gt; 'http://my.external.api/']);
      // Send a request to http://my.external.api/site/67/module/1449/item
      $response = $client-&gt;request('GET', 'site/67/module/1449/item', ['auth' =&gt; ['****', '****']]);
      var_dump($response);
      exit;
      return $this-&gt;json(array($response));
  }
  }
  </code></pre>
  
  <p>I am getting the following <code>var_dump($response)</code> from my code:</p>
  
  <p><code>object(GuzzleHttp\Psr7\Response)#397 (6) { ["reasonPhrase":"GuzzleHttp\Psr7\Response":private]=&gt; string(2) "OK" ["statusCode":"GuzzleHttp\Psr7\Response":private]=&gt; int(200) ["headers":"GuzzleHttp\Psr7\Response":private]=&gt; array(11) { ["Date"]=&gt; array(1) { [0]=&gt; string(29) "Tue, 24 Jan 2017 19:39:17 GMT" } ["Server"]=&gt; array(1) { [0]=&gt; string(6) "Apache" } ["Cache-Control"]=&gt; array(2) { [0]=&gt; string(35) "no-cache, no-store, must-revalidate" [1]=&gt; string(46) "no-cache, no-store, max-age=0, must-revalidate" } ["Pragma"]=&gt; array(2) { [0]=&gt; string(8) "no-cache" [1]=&gt; string(8) "no-cache" } ["Expires"]=&gt; array(2) { [0]=&gt; string(1) "0" [1]=&gt; string(1) "0" } ["X-Content-Type-Options"]=&gt; array(1) { [0]=&gt; string(7) "nosniff" } ["X-XSS-Protection"]=&gt; array(1) { [0]=&gt; string(13) "1; mode=block" } ["X-Frame-Options"]=&gt; array(1) { [0]=&gt; string(4) "DENY" } ["Set-Cookie"]=&gt; array(1) { [0]=&gt; string(64) "SiteIdentifier=67; Expires=Wed, 25-Jan-2017 19:39:17 GMT; Path=/" } ["Transfer-Encoding"]=&gt; array(1) { [0]=&gt; string(7) "chunked" } ["Content-Type"]=&gt; array(1) { [0]=&gt; string(30) "application/json;charset=UTF-8" } } ["headerNames":"GuzzleHttp\Psr7\Response":private]=&gt; array(11) { ["date"]=&gt; string(4) "Date" ["server"]=&gt; string(6) "Server" ["cache-control"]=&gt; string(13) "Cache-Control" ["pragma"]=&gt; string(6) "Pragma" ["expires"]=&gt; string(7) "Expires" ["x-content-type-options"]=&gt; string(22) "X-Content-Type-Options" ["x-xss-protection"]=&gt; string(16) "X-XSS-Protection" ["x-frame-options"]=&gt; string(15) "X-Frame-Options" ["set-cookie"]=&gt; string(10) "Set-Cookie" ["transfer-encoding"]=&gt; string(17) "Transfer-Encoding" ["content-type"]=&gt; string(12) "Content-Type" } ["protocol":"GuzzleHttp\Psr7\Response":private]=&gt; string(3) "1.1" ["stream":"GuzzleHttp\Psr7\Response":private]=&gt; object(GuzzleHttp\Psr7\Stream)#395 (7) { ["stream":"GuzzleHttp\Psr7\Stream":private]=&gt; resource(328) of type (stream) ["size":"GuzzleHttp\Psr7\Stream":private]=&gt; NULL ["seekable":"GuzzleHttp\Psr7\Stream":private]=&gt; bool(true) ["readable":"GuzzleHttp\Psr7\Stream":private]=&gt; bool(true) ["writable":"GuzzleHttp\Psr7\Stream":private]=&gt; bool(true) ["uri":"GuzzleHttp\Psr7\Stream":private]=&gt; string(10) "php://temp" ["customMetadata":"GuzzleHttp\Psr7\Stream":private]=&gt; array(0) { } } }</code></p>
  
  <p>When I run HTTP GET through <a href="https://www.getpostman.com/" rel="nofollow noreferrer">Postman</a>, I get results such as:</p>
  
  <p><code>"fields":[{"options":[{"id":23034,"value":"Ready for scheduling"}],"fieldDefinitionId":16444,"name":"Job Status"}</code></p>
  
  <p>What is the <code>$response</code> I am currently getting, and how do I get a JSON array response of the content I am looking for from my external API?</p>