ResultStream
in
Stream for a Result.
Table of Contents
Methods
- getChunks() : iterable<string|int, string>
- Download the response in chunks.
- getContentAsResource() : resource
- Download content into a resource and then return that resource.
- getContentAsString() : string
- Download content into a temporary resource and return a string.
Methods
getChunks()
Download the response in chunks.
public
getChunks() : iterable<string|int, string>
$fileHandler = fopen('/output.pdf', 'w'); foreach ($result->getBody()->getChunks() as $chunk) { fwrite($fileHandler, $chunk); }
Return values
iterable<string|int, string>getContentAsResource()
Download content into a resource and then return that resource.
public
getContentAsResource() : resource
Return values
resourcegetContentAsString()
Download content into a temporary resource and return a string.
public
getContentAsString() : string