interface EntityBodyInterface

Entity body used with an HTTP request or response

Hierarchy

Expanded class hierarchy of EntityBodyInterface

All classes that implement EntityBodyInterface

6 files declare their use of EntityBodyInterface
EntityEnclosingRequest.php in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/EntityEnclosingRequest.php
EntityEnclosingRequestInterface.php in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/EntityEnclosingRequestInterface.php
Request.php in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Request.php
RequestFactoryInterface.php in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/RequestFactoryInterface.php
RequestInterface.php in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/RequestInterface.php

... See full list

File

drupal/core/vendor/guzzle/http/Guzzle/Http/EntityBodyInterface.php, line 10

Namespace

Guzzle\Http
View source
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();

}

Members

Name Modifiers Typesort descending Description Overrides
EntityBodyInterface::setRewindFunction 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::compress 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::uncompress public function Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream. 2
EntityBodyInterface::getContentLength public function Get the Content-Length of the entity body if possible (alias of getSize) 2
EntityBodyInterface::getContentType public function Guess the Content-Type or return the default application/octet-stream 2
EntityBodyInterface::getContentMd5 public function Get an MD5 checksum of the stream's contents 2
EntityBodyInterface::getContentEncoding public function Get the Content-Encoding of the EntityBody 2
StreamInterface::__toString public function Convert the stream to a string if the stream is readable and the stream is seekable. 2
StreamInterface::getMetaData public function Get stream metadata 2
StreamInterface::getStream public function Get the stream resource 2
StreamInterface::setStream public function Set the stream that is wrapped by the object 2
StreamInterface::getWrapper public function Get the stream wrapper type 2
StreamInterface::getWrapperData public function Wrapper specific data attached to this stream. 2
StreamInterface::getStreamType public function Get a label describing the underlying implementation of the stream 2
StreamInterface::getUri public function Get the URI/filename associated with this stream 2
StreamInterface::getSize public function Get the size of the stream if able 2
StreamInterface::isReadable public function Check if the stream is readable 2
StreamInterface::isWritable public function Check if the stream is writable 2
StreamInterface::isConsumed public function Check if the stream has been consumed 2
StreamInterface::isLocal public function Check if the stream is a local stream vs a remote stream 2
StreamInterface::isSeekable public function Check if the string is repeatable 2
StreamInterface::setSize public function Specify the size of the stream in bytes 2
StreamInterface::seek public function Seek to a position in the stream 2
StreamInterface::read public function Read data from the stream 2
StreamInterface::write public function Write data to the stream 2
StreamInterface::ftell public function Returns the current position of the file read/write pointer 2
StreamInterface::rewind public function Rewind to the beginning of the stream 2