title: LARAVEL RESTAPI only working through postman and not with Guzzle
body: <p>Well i have a strange issue, I have 2 instances of laravel5. One works as an api, while the other one works as a frontend website. I am using guzzle 6 (an http client library) on the frontend website for api requests. </p>
  
  <p>I have 2 routes on the api:</p>
  
  <ol>
  <li><a href="http://example.dev/api/test" rel="nofollow">http://example.dev/api/test</a> (returns 'hello') )</li>
  <li><a href="http://example.dev/api/authenticate" rel="nofollow">http://example.dev/api/authenticate</a> ( returns OAUTH2 or JWT access_token)</li>
  </ol>
  
  <p><strong>The first route (test) works fine with both postman and GUZZLE and Here is the code. (Note: The form params are not necessary for this route, but i have included to show the difference )</strong></p>
  
  <pre><code>    $client = new Client(['base_uri' =&gt; 'http://example.dev/api/']);
  
      $response = $client-&gt;request('POST', 'test', [
          'form_params' =&gt; [                    // Not necessary
              'username' =&gt; 'email@example.com',// Not necessary
              'password' =&gt; 'password',         // Not necessary
          ]
      ]);
  
      $result = json_decode($response-&gt;getBody()-&gt;getContents(), true); 
      dd($result);
  </code></pre>
  
  <p><strong>The Second Route (authenticate) Works with POSTMAN and we get a token back but not with guzzle.</strong></p>
  
  <pre><code>$client = new Client(['base_uri' =&gt; 'http://example.dev/api/']);
  
  $response = $client-&gt;request('POST', 'authenticate', [
      'form_params' =&gt; [                    
          'username' =&gt; 'email@example.com',
          'password' =&gt; 'password',         
      ]
  ]);
  
  $result = json_decode($response-&gt;getBody()-&gt;getContents(), true); 
  dd($result);
  </code></pre>
  
  <p>The error i recieve on the second route is "ServerException in Middleware.php line 68:". Although no middleware has been assigned to it, Another question also has a very similar problem and they solved it with some modification to the above code.</p>
  
  <p>I have been banging my head for 2 days now, and there are so many different versions of guzzle, and every version has its own code. <strong>I have tried using both OAuth2 &amp; JWT but i think there is some kind of header missing or something.</strong></p>
  
  <p>It would be really great if you can share the code that works no matter what version of guzzle it is, as i can downgrade it. </p>