Answers for "guzzle send json in post request"

PHP
0

guzzlehttp post json example

use GuzzleHttpClient;

$client = new Client();

$response = $client->post('url', [
    GuzzleHttpRequestOptions::JSON => ['foo' => 'bar'] // or 'json' => [...]
]);
Posted by: Guest on April-14-2021
0

php convert guzzle response to json

$response = GuzzleHttpget('http://httpbin.org/get');
if ($response->getBody()) {
    echo $response->getBody();
    // JSON string: { ... }
}
Posted by: Guest on August-12-2020

Code answers related to "guzzle send json in post request"

Browse Popular Code Answers by Language