title: guzzlephp in Laravel : send post request with form-data parameters like postman form-data
body: <p>I want to send data with post Request to an API.
  With postman this API only worked when i set parameters as a form-data in body like this picture </p>
  
  <p><a href="https://i.stack.imgur.com/RnAvd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RnAvd.jpg" alt="enter image description here"></a></p>
  
  <p>This is my code </p>
  
  <pre><code>     $params = array(
          'From ' =&gt; 'THR',
          'To' =&gt; 'KIH',
          'Date' =&gt; '2019/09/17' ,
          'AdultCount' =&gt; '1' ,
          'ChildCount' =&gt; '0',
          'InfantCount' =&gt; '0',
          'ApiSiteID' =&gt;  '198-10001-1-10' ,
          'UserID' =&gt;  '3df91-s77' ,
      );
      $client = new Client(['base_uri' =&gt; 'http://something.site.ir/api/FlightReservationApi/'] );
        $response = $client-&gt;request('POST', 'SearchFlightData' ,
          [      'form_params' =&gt; [  $params] ] );
  
      $body= $response-&gt;getBody();
      $remainingBytes = $body-&gt;getContents();
      dd($remainingBytes);
  </code></pre>
  
  <p>But it's not worked for me. 
  i use this all of parameters (json , form_params , body ) and none of them dosen't work for me  </p>
  
  <p>I use laravel 5.4  , and guzzle 6.3</p>
  
  <p>According to guzzlephp document this config for <strong>application/x-www-form-urlencoded</strong> sending parameters but i need a config for <strong>form-data</strong> sending parameters</p>
  
  <blockquote>
    <p>Sending application/x-www-form-urlencoded POST requests requires that you >specify the POST fields as an array in the form_params request options.</p>
  </blockquote>
  
  <pre><code>$response = $client-&gt;request('POST', 'http://httpbin.org/post', [
      'form_params' =&gt; [
          'field_name' =&gt; 'abc',
          'other_field' =&gt; '123',
          'nested_field' =&gt; [
              'nested' =&gt; 'hello'
          ]
      ]
  ]);
  </code></pre>