form_params
Summary
Used to send an application/x-www-form-urlencoded POST request.
Types
array
Constant
GuzzleHttp\RequestOptions::FORM_PARAMS
Associative array of form field names to values where each value is a string or array of strings. Sets the Content-Type header to application/x-www-form-urlencoded when no Content-Type header is already present.
$client->request('POST', '/post', [
'form_params' => [
'foo' => 'bar',
'baz' => ['hi', 'there!']
]
]);
Note
form_params
cannot be used with the multipart
option. You will need to use one or the other. Use form_params
for application/x-www-form-urlencoded
requests, and multipart
for multipart/form-data
requests.
This option cannot be used with body
, multipart
, or json