pader/amphp-guzzle-handler

Make guzzle non-blocking with amphp.

dev-main 2024-01-31 08:59 UTC

This package is auto-updated.

Last update: 2024-10-30 01:32:11 UTC


README

Make guzzle non-blocking with amphp.

use Amp\Http\Client\HttpClientBuilder;
use AmpGuzzle\HttpClientHandler;
use GuzzleHttp\Client;

$httpClient = HttpClientBuilder::buildDefault();

$handler = new HttpClientHandler($httpClient);

$client = new Client([
    'handler' => $handler
]);

$response = $client->post('https://www.google.com/');

print_r($response->getBody()->getContents());