Reputation: 53
I want to print out the request header of a POST request, but I can't find the answer by searching the web. Can someone explain how to do this?
I have this array that I pass in the POST request as $value. I want to see how it's parsed in the GuzzleHTTP POST request.
Array example
Array
(
[username] => admin
[password] => pass
[submit] => login
)
$client->request('POST', $url, [
'form_params' => [
$value
]
]);
Upvotes: 5
Views: 7153
Reputation: 4308
You should enable debug output, like so :
$client->request('POST', $url, ['form_params' => [$value], 'debug' => true]);
Source & doc : http://docs.guzzlephp.org/en/stable/request-options.html#debug
Upvotes: 4