Registry / http-client / amphp-http-client

amphp-http-client

JSON →
library5.3.4phppackagistunverified

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.

composer require amphp/http-client
INSTALL
IMPORT
SIG · AMPHP-HTTP-CLIENT
A
amphp-http-client
http-clientphpv5.3.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HttpClient
use Amp\Http\Client\HttpClient;

Make an asynchronous HTTP GET request.

use Amp\Http\Client\HttpClient; use Amp\Http\Client\Request; $client = new HttpClient(); $response = $client->request(new Request('https://example.com')); $body = $response->getBody()->buffer();
Debug
Known issues
gotchaRequires an event loop (e.g., Amp\Loop::run()) to execute.
fix
Wrap your code in Amp\Loop::run() or use a coroutine.
affects: >=5.0.0
Upgrade
Version history
5.3.4latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
43 hits · last 30 days
node
34
Amazon
1
Perplexity
1
OpenAI (training)
1
Resources
amphp-http-client — pip install amphp-http-client · libregistry