title: Getting 404 when using Guzzle POST in Laravel - Works in curl
body: <p>ok so i'm playing around guzzle and seems like I can't get POST to work. It works on curl cli but not in laravel guzzle. am I doing something wrong?</p>
  
  <p>Here's my curl (working fine)</p>
  
  <pre><code>curl -i -d 'locationID=2&amp;firstname=John&amp;middlename=Dee&amp;lastname=Doe&amp;sourceID=2&amp;typeID=2&amp;email=johndoe@yahoo.com&amp;emailtypeID=2&amp;phone=1234567890&amp;phonetypeID=2' http://api.company.com/v1/members
  
  HTTP/1.1 200 OK
  Date: Thu, 07 May 2015 14:15:25 GMT
  Server: Apache/2.4.7 (Ubuntu)
  X-Powered-By: PHP/5.5.9-1ubuntu4.5
  Cache-Control: no-cache
  Set-Cookie: laravel_session=eyJpdi; 
  expires=Thu, 07-May-2015 16:15:26 GMT; 
  Max-Age=7200; 
  path=/; httponly
  Access-Control-Allow-Origin: *
  Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
  Access-Control-Allow-Methods: GET, POST, PUT, DELETE
  Content-Length: 59
  Content-Type: application/json
  </code></pre>
  
  <p>and here's my controller</p>
  
  <pre><code>use GuzzleHttp\Client;
  
  public function postForm(Request $request)
  {
      $client = new Client(); 
      $response = $client-&gt;post('http://api.company.com/v1/members',
          array(
              'body' =&gt; array(
                  'firstname' =&gt; $firstname,
                  'middlename' =&gt; $middlename,
                  'lastname' =&gt; $lastname,
                  'locationID' =&gt; $locationID,
                  'phonetypeID' =&gt; $phonetypeID,
                  'phone' =&gt; $phone,
                  'emailtypeID' =&gt; $emailtypeID,
                  'email' =&gt; $email,
                  'sourceID' =&gt; $sourceID,
                  'typeID' =&gt; $typeID
              )
          )
      );
      $body = $response-&gt;send();
      $content = view('member.create_result')-&gt;with('member',json_decode($body, TRUE));
      return Admin::view($content, 'Member Added');
  }
  </code></pre>
  
  <p>Error i'm getting</p>
  
  <pre><code>Client error response [url] http://api.company.com/v1/members [status code] 404 [reason phrase] Not Found
  </code></pre>