Methods summary
public static
Guzzle\Http\EntityBody
|
#
factory( resource|string|Guzzle\Http\EntityBody $resource = '', integer $size = null )
Create a new EntityBody based on the input type
Create a new EntityBody based on the input type
Parameters
- $resource
resource|string|Guzzle\Http\EntityBody $resource Entity body data
- $size
integer $size Size of the data contained in the resource
Returns
Throws
|
public
Guzzle\Http\EntityBody
|
#
setRewindFunction( mixed $callable )
Specify a custom callback used to rewind a non-seekable stream. This can be
useful entity enclosing requests that are redirected.
Specify a custom callback used to rewind a non-seekable stream. This can be
useful entity enclosing requests that are redirected.
Parameters
- $callable
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.
Returns
Implementation of
|
public
boolean
|
#
rewind( )
Rewind to the beginning of the stream
Rewind to the beginning of the stream
Returns
boolean Returns true on success or false on failure
Overrides
Implementation of
|
public static
Guzzle\Http\EntityBody
|
#
fromString( string $string )
Create a new EntityBody from a string
Create a new EntityBody from a string
Parameters
- $string
string $string String of data
Returns
|
public
boolean
|
#
compress( string $filter = 'zlib.deflate' )
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.
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.
Parameters
- $filter
string $filter Compression filter
Returns
boolean Returns TRUE on success or FALSE on failure
Implementation of
|
public
boolean
|
#
uncompress( string $filter = 'zlib.inflate' )
Decompress a deflated string. Once uncompressed, the uncompressed string is
then used as the wrapped stream.
Decompress a deflated string. Once uncompressed, the uncompressed string is
then used as the wrapped stream.
Parameters
- $filter
string $filter De-compression filter
Returns
boolean Returns TRUE on success or FALSE on failure
Implementation of
|
public
integer|boolean
|
#
getContentLength( )
Get the Content-Length of the entity body if possible (alias of getSize)
Get the Content-Length of the entity body if possible (alias of getSize)
Returns
integer|boolean Returns the Content-Length or false on failure
Implementation of
|
public
string|null
|
#
getContentType( )
Guess the Content-Type of a local stream
Guess the Content-Type of a local stream
Returns
string|null
Implementation of
|
public
boolean|string
|
#
getContentMd5( boolean $rawOutput = false, boolean $base64Encode = false )
Get an MD5 checksum of the stream's contents
Get an MD5 checksum of the stream's contents
Parameters
- $rawOutput
boolean $rawOutput Whether or not to use raw output
- $base64Encode
boolean $base64Encode Whether or not to base64 encode raw output (only if raw output is
true)
Returns
boolean|string Returns an MD5 string on success or FALSE on failure
Implementation of
|
public
|
|
public
boolean|string
|
#
getContentEncoding( )
Get the Content-Encoding of the EntityBody
Get the Content-Encoding of the EntityBody
Returns
boolean|string
Implementation of
|
protected
|
|