Interface EntityBodyInterface
Entity body used with an HTTP request or response
- Guzzle\Http\EntityBodyInterface implements Guzzle\Stream\StreamInterface
Direct known implementers
Guzzle\Http\AbstractEntityBodyDecorator,
Guzzle\Http\EntityBody
Indirect known implementers
Guzzle\Http\CachingEntityBody,
Guzzle\Http\IoEmittingEntityBody,
Guzzle\Http\ReadLimitEntityBody
Methods summary
-
publicsetRewindFunction ( mixed $callable )Specify a custom callback used to rewind a non-seekable stream. This can be useful entity enclosing requests that are redirected.
-
publiccompress ( 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.
-
publicuncompress ( string $filter = 'zlib.inflate' )Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream.
-
publicgetContentLength ( )Get the Content-Length of the entity body if possible (alias of getSize)
-
publicgetContentType ( )Guess the Content-Type of a local stream
-
publicgetContentMd5 ( bool $rawOutput = false, bool $base64Encode = false )Get an MD5 checksum of the stream's contents
-
publicgetContentEncoding ( )Get the Content-Encoding of the EntityBody
Methods detail
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
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
booleanReturns TRUE on success or FALSE on failure
Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream.
Parameters
- $filter
string
$filter De-compression filter
Returns
booleanReturns TRUE on success or FALSE on failure
Get the Content-Length of the entity body if possible (alias of getSize)
Returns
integer|booleanReturns the Content-Length or false on failure
Guess the Content-Type of a local stream
Returns
string|nullSee
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|stringReturns an MD5 string on success or FALSE on failure
Get the Content-Encoding of the EntityBody
Returns
boolean|stringMethods inherited from Guzzle\Stream\StreamInterface
__toString(),
close(),
detachStream(),
feof(),
ftell(),
getCustomData(),
getMetaData(),
getSize(),
getStream(),
getStreamType(),
getUri(),
getWrapper(),
getWrapperData(),
isConsumed(),
isLocal(),
isReadable(),
isRepeatable(),
isSeekable(),
isWritable(),
read(),
readLine(),
rewind(),
seek(),
setCustomData(),
setSize(),
setStream(),
write()