Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 385 Bytes

streaming.md

File metadata and controls

14 lines (12 loc) · 385 Bytes
title permalink
Streaming
/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;
}