Entity body used with an HTTP request or response
Expanded class hierarchy of EntityBodyInterface
All classes that implement EntityBodyInterface
interface EntityBodyInterface extends StreamInterface {
/**
* Specify a custom callback used to rewind a non-seekable stream. This can be useful entity enclosing requests
* that are redirected.
*
* @param 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.
* @return self
*/
public function setRewindFunction($callable);
/**
* 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.
*
* @param string $filter Compression filter
*
* @return bool Returns TRUE on success or FALSE on failure
*/
public function compress($filter = 'zlib.deflate');
/**
* Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream.
*
* @param string $filter De-compression filter
*
* @return bool Returns TRUE on success or FALSE on failure
*/
public function uncompress($filter = 'zlib.inflate');
/**
* Get the Content-Length of the entity body if possible (alias of getSize)
*
* @return int|bool Returns the Content-Length or false on failure
*/
public function getContentLength();
/**
* Guess the Content-Type or return the default application/octet-stream
*
* @return string
* @see http://www.php.net/manual/en/function.finfo-open.php
*/
public function getContentType();
/**
* Get an MD5 checksum of the stream's contents
*
* @param bool $rawOutput Whether or not to use raw output
* @param bool $base64Encode 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
*/
public function getContentMd5($rawOutput = false, $base64Encode = false);
/**
* Get the Content-Encoding of the EntityBody
*
* @return bool|string
*/
public function getContentEncoding();
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityBodyInterface:: |
public | function | 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. | 2 |
EntityBodyInterface:: |
public | function | Get the Content-Encoding of the EntityBody | 2 |
EntityBodyInterface:: |
public | function | Get the Content-Length of the entity body if possible (alias of getSize) | 2 |
EntityBodyInterface:: |
public | function | Get an MD5 checksum of the stream's contents | 2 |
EntityBodyInterface:: |
public | function | Guess the Content-Type or return the default application/octet-stream | 2 |
EntityBodyInterface:: |
public | function | Specify a custom callback used to rewind a non-seekable stream. This can be useful entity enclosing requests that are redirected. | 2 |
EntityBodyInterface:: |
public | function | Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream. | 2 |
StreamInterface:: |
public | function | Returns the current position of the file read/write pointer | 2 |
StreamInterface:: |
public | function | Get stream metadata | 2 |
StreamInterface:: |
public | function | Get the size of the stream if able | 2 |
StreamInterface:: |
public | function | Get the stream resource | 2 |
StreamInterface:: |
public | function | Get a label describing the underlying implementation of the stream | 2 |
StreamInterface:: |
public | function | Get the URI/filename associated with this stream | 2 |
StreamInterface:: |
public | function | Get the stream wrapper type | 2 |
StreamInterface:: |
public | function | Wrapper specific data attached to this stream. | 2 |
StreamInterface:: |
public | function | Check if the stream has been consumed | 2 |
StreamInterface:: |
public | function | Check if the stream is a local stream vs a remote stream | 2 |
StreamInterface:: |
public | function | Check if the stream is readable | 2 |
StreamInterface:: |
public | function | Check if the string is repeatable | 2 |
StreamInterface:: |
public | function | Check if the stream is writable | 2 |
StreamInterface:: |
public | function | Read data from the stream | 2 |
StreamInterface:: |
public | function | Rewind to the beginning of the stream | 2 |
StreamInterface:: |
public | function | Seek to a position in the stream | 2 |
StreamInterface:: |
public | function | Specify the size of the stream in bytes | 2 |
StreamInterface:: |
public | function | Set the stream that is wrapped by the object | 2 |
StreamInterface:: |
public | function | Write data to the stream | 2 |
StreamInterface:: |
public | function | Convert the stream to a string if the stream is readable and the stream is seekable. | 2 |