Interface Guzzle\Http\EntityBodyInterface

ExtendsGuzzle\Stream\StreamInterface
Implemented byGuzzle\Http\AbstractEntityBodyDecorator, Guzzle\Http\CachingEntityBody, Guzzle\Http\EntityBody, Guzzle\Http\IoEmittingEntityBody, Guzzle\Http\ReadLimitEntityBody

Entity body used with an HTTP request or response

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__toString() Convert the stream to a string if the stream is readable and the stream is seekable. Guzzle\Stream\StreamInterface
close() Close the underlying stream Guzzle\Stream\StreamInterface
compress() 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. Guzzle\Http\EntityBodyInterface
detachStream() Detach the current stream resource Guzzle\Stream\StreamInterface
feof() Alias of isConsumed Guzzle\Stream\StreamInterface
ftell() Returns the current position of the file read/write pointer Guzzle\Stream\StreamInterface
getContentEncoding() Get the Content-Encoding of the EntityBody Guzzle\Http\EntityBodyInterface
getContentLength() Get the Content-Length of the entity body if possible (alias of getSize) Guzzle\Http\EntityBodyInterface
getContentMd5() Get an MD5 checksum of the stream's contents Guzzle\Http\EntityBodyInterface
getContentType() Guess the Content-Type of a local stream Guzzle\Http\EntityBodyInterface
getCustomData() Get custom data from the stream Guzzle\Stream\StreamInterface
getMetaData() Get stream metadata Guzzle\Stream\StreamInterface
getSize() Get the size of the stream if able Guzzle\Stream\StreamInterface
getStream() Get the stream resource Guzzle\Stream\StreamInterface
getStreamType() Get a label describing the underlying implementation of the stream Guzzle\Stream\StreamInterface
getUri() Get the URI/filename associated with this stream Guzzle\Stream\StreamInterface
getWrapper() Get the stream wrapper type Guzzle\Stream\StreamInterface
getWrapperData() Wrapper specific data attached to this stream. Guzzle\Stream\StreamInterface
isConsumed() Check if the stream has been consumed Guzzle\Stream\StreamInterface
isLocal() Check if the stream is a local stream vs a remote stream Guzzle\Stream\StreamInterface
isReadable() Check if the stream is readable Guzzle\Stream\StreamInterface
isRepeatable() Check if the stream is repeatable Guzzle\Stream\StreamInterface
isSeekable() Check if the string is repeatable Guzzle\Stream\StreamInterface
isWritable() Check if the stream is writable Guzzle\Stream\StreamInterface
read() Read data from the stream Guzzle\Stream\StreamInterface
readLine() Read a line from the stream up to the maximum allowed buffer length Guzzle\Stream\StreamInterface
rewind() Rewind to the beginning of the stream Guzzle\Stream\StreamInterface
seek() Seek to a position in the stream Guzzle\Stream\StreamInterface
setCustomData() Set custom data on the stream Guzzle\Stream\StreamInterface
setRewindFunction() Specify a custom callback used to rewind a non-seekable stream. This can be useful entity enclosing requests that are redirected. Guzzle\Http\EntityBodyInterface
setSize() Specify the size of the stream in bytes Guzzle\Stream\StreamInterface
setStream() Set the stream that is wrapped by the object Guzzle\Stream\StreamInterface
uncompress() Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream. Guzzle\Http\EntityBodyInterface
write() Write data to the stream Guzzle\Stream\StreamInterface

Method Details

compress() public abstract method

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.

public abstract bool compress ( $filter 'zlib.deflate' )
$filter string

Compression filter

return bool

Returns TRUE on success or FALSE on failure

getContentEncoding() public abstract method

Get the Content-Encoding of the EntityBody

public abstract bool|string getContentEncoding ( )
getContentLength() public abstract method

Get the Content-Length of the entity body if possible (alias of getSize)

public abstract int|bool getContentLength ( )
return int|bool

Returns the Content-Length or false on failure

getContentMd5() public abstract method

Get an MD5 checksum of the stream's contents

public abstract bool|string getContentMd5 ( $rawOutput false, $base64Encode false )
$rawOutput bool

Whether or not to use raw output

$base64Encode bool

Whether or not to base64 encode raw output (only if raw output is true)

return bool|string

Returns an MD5 string on success or FALSE on failure

getContentType() public abstract method

Guess the Content-Type of a local stream

See also http://www.php.net/manual/en/function.finfo-open.php.

public abstract string|null getContentType ( )
setRewindFunction() public abstract method

Specify a custom callback used to rewind a non-seekable stream. This can be useful entity enclosing requests that are redirected.

public abstract self setRewindFunction ( $callable )
$callable mixed

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.
uncompress() public abstract method

Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream.

public abstract bool uncompress ( $filter 'zlib.inflate' )
$filter string

De-compression filter

return bool

Returns TRUE on success or FALSE on failure