A fully async, non-blocking HTTP client built using stream_socket_client and stream_select. No cURL. No Guzzle.
- ๐ Non-blocking requests using PHP streams
- ๐ Multiple async requests in parallel
- ๐ Retries and timeout support
- ๐งฉ PSR-18 / PSR-7 compatible
- โ GET, POST, PUT, PATCH, DELETE supported
composer require async-http/async-http<?php
require_once('vendor/autoload.php');
use Async\Http\AsyncHttpClient;
$url = 'https://jsonplaceholder.typicode.com/posts';
$client = new AsyncHttpClient();
foreach ($client->get($url) as $response) {
echo $response->getBody();
}