HumHub Documentation (unofficial)

ResponseBodyStream
in package
implements ResultStream

Stream a HTTP response body.

This class is a BC layer for Http Response that does not support toStream(). When calling getChunks you must read all the chunks before being able to call this method (or another method) again. When calling getContentAsResource, it first, fully read the Response Body in a blocking way.

Tags
author

Tobias Nyholm tobias.nyholm@gmail.com

author

Jérémy Derussé jeremy@derusse.com

Table of Contents

Interfaces

ResultStream
Stream for a Result.

Properties

$fallback  : ResponseBodyResourceStream|null
$partialRead  : bool
$responseStream  : ResponseStreamInterface

Methods

__construct()  : mixed
__toString()  : string
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.

Properties

Methods

getChunks()

Download the response in chunks.

public getChunks() : iterable<string|int, string>
Return values
iterable<string|int, string>

getContentAsResource()

Download content into a resource and then return that resource.

public getContentAsResource() : resource
Return values
resource

getContentAsString()

Download content into a temporary resource and return a string.

public getContentAsString() : string
Return values
string

        
On this page

Search results