title: Guzzle - 400 Bad Request` response: {"error":"invalid_client"} - when making token request
body: <p>I'm trying to make a token request using guzzle and receive an error "400 Bad Request` response: {"error":"invalid_client"}".  I can make the same request with cURL and HTTP_Request2 with no problem.</p>
  
  <pre><code>&lt;?php
      require 'vendor/autoload.php';
      use GuzzleHttp\Client;
      use GuzzleHttp\Exception\RequestException;
      use GuzzleHttp\Psr7\Request;
  
      session_start();
      if(isset($_GET['code'])){
          $code = $_GET['code'];
          $encodeB64 = base64_encode('{clientID}:{clientSecret}');
          $client = new GuzzleHttp\Client();
          $response = $client-&gt;request('POST', 'https://identity.reckon.com/connect/token',[
          ['headers' =&gt; ['Content-Type' =&gt; 'application/x-www-form-urlencoded'],['Authorization' =&gt; 'Basic '.$encodeB64]],
          ['body' =&gt; ['grant_type' =&gt; 'authorization_code'],['code' =&gt; $code],['redirect_uri' =&gt; '{redirectURI}']]
          ]);
          $body = $response-&gt;getBody();
          echo $body;
      }
  </code></pre>
  
  <p>These are the details of how to make a token request with this API:</p>
  
  <p>URL: <a href="https://identity.reckon.com/connect/token" rel="nofollow noreferrer">https://identity.reckon.com/connect/token</a></p>
  
  <p>Type: POST</p>
  
  <p>Body: grant_type=authorization_code&amp;code={code}&amp;redirect_uri={redirect url}</p>
  
  <p>Headers:</p>
  
  <ul>
  <li><p>Content-Type = application/x-www-form-urlencoded </p></li>
  <li><p>Authorization: Basic{client id:client secret encoded in base64}</p></li>
  </ul>
  
  <p>Not sure where I'm going wrong.</p>