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-04-30 00:34:15 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());