Answers for "guzzlehttp response"

PHP
0

guzzlehttp post json example

use GuzzleHttp\Client;

$client = new Client();

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

guzzle get request

$client = new Client([(['base_uri' => 'https://reqres.in/']);

$response = $client->request('GET', '/api/users?page=1');
        
echo $response->getBody();
Posted by: Guest on March-31-2022

Browse Popular Code Answers by Language