STREAM_TYPE
STREAM_TYPE = 'stream_type'
Entity body used with an HTTP request or response
__construct(resource $stream, integer $size = null)
resource | $stream | Stream resource to wrap |
integer | $size | Size of the stream in bytes. Only pass if the size cannot be obtained from the stream. |
if the stream is not a stream resource
getHash(\Guzzle\Stream\StreamInterface $stream, string $algo, boolean $rawOutput = false) : boolean|string
Calculate a hash of a Stream
\Guzzle\Stream\StreamInterface | $stream | Stream to calculate the hash for |
string | $algo | Hash algorithm (e.g. md5, crc32, etc) |
boolean | $rawOutput | Whether or not to use raw output |
Returns false on failure or a hash string on success
factory(resource|string|\Guzzle\Http\EntityBody $resource = '', integer $size = null) : \Guzzle\Http\EntityBody
Create a new EntityBody based on the input type
resource|string|\Guzzle\Http\EntityBody | $resource | Entity body data |
integer | $size | Size of the data contained in the resource |
if the $resource arg is not a resource or string
setRewindFunction(mixed $callable) : self
Specify a custom callback used to rewind a non-seekable stream. This can be useful entity enclosing requests that are redirected.
mixed | $callable | Callable to invoke to rewind a non-seekable stream. The callback must accept an EntityBodyInterface object, perform the rewind if possible, and return a boolean representing whether or not the rewind was successful. |
fromString(string $string) : \Guzzle\Http\EntityBody
Create a new EntityBody from a string
string | $string | String of data |
compress(string $filter = 'zlib.deflate') : boolean
If the stream is readable, compress the data in the stream using deflate compression. The uncompressed stream is then closed, and the compressed stream then becomes the wrapped stream.
string | $filter | Compression filter |
Returns TRUE on success or FALSE on failure
getContentMd5(boolean $rawOutput = false, boolean $base64Encode = false) : boolean|string
Get an MD5 checksum of the stream's contents
boolean | $rawOutput | Whether or not to use raw output |
boolean | $base64Encode | Whether or not to base64 encode raw output (only if raw output is true) |
Returns an MD5 string on success or FALSE on failure
calculateMd5(\Guzzle\Http\EntityBodyInterface $body, boolean $rawOutput = false, boolean $base64Encode = false) : boolean|string
Calculate the MD5 hash of an entity body
\Guzzle\Http\EntityBodyInterface | $body | Entity body to calculate the hash for |
boolean | $rawOutput | Whether or not to use raw output |
boolean | $base64Encode | Whether or not to base64 encode raw output (only if raw output is true) |
Returns an MD5 string on success or FALSE on failure
setStreamFilterContentEncoding( $streamFilterContentEncoding)
$streamFilterContentEncoding |
None found |
getContentEncoding() : boolean|string
Get the Content-Encoding of the EntityBody
None found |
None found |
None found |