Documentation Packages Support

Http Client ⋅ Streaming

Artax allows streaming the response body by using the Payload API of amphp/byte-stream.

$response = yield $client->request("https://httpbin.org/get");

$body = $response->getBody();
while (null !== $chunk = yield $body->read()) {
    print $chunk;
}