POST request with data/parameters using Request class

43 views
Skip to first unread message

Steven Bara

unread,
May 19, 2016, 7:53:45 AM5/19/16
to Guzzle - PHP HTTP client and REST client framework

The documentation says:


You can create a request and then send the request with the client when you're ready:

use GuzzleHttp\Psr7\Request;

$request = new Request('PUT', 'http://httpbin.org/put');
$response = $client->send($request, ['timeout' => 2]);
But how do I create a POST request with parameters/data to send?
Reply all
Reply to author
Forward
0 new messages