Open Journal Systems  3.3.0
Guzzle\Http\EntityBodyInterface Interface Reference
Inheritance diagram for Guzzle\Http\EntityBodyInterface:
Guzzle\Stream\StreamInterface Guzzle\Http\AbstractEntityBodyDecorator Guzzle\Http\EntityBody Guzzle\Http\CachingEntityBody Guzzle\Http\IoEmittingEntityBody Guzzle\Http\ReadLimitEntityBody

Public Member Functions

 compress ($filter='zlib.deflate')
 
 getContentEncoding ()
 
 getContentLength ()
 
 getContentMd5 ($rawOutput=false, $base64Encode=false)
 
 getContentType ()
 
 setRewindFunction ($callable)
 
 uncompress ($filter='zlib.inflate')
 
- Public Member Functions inherited from Guzzle\Stream\StreamInterface
 __toString ()
 
 close ()
 
 detachStream ()
 
 feof ()
 
 ftell ()
 
 getCustomData ($key)
 
 getMetaData ($key=null)
 
 getSize ()
 
 getStream ()
 
 getStreamType ()
 
 getUri ()
 
 getWrapper ()
 
 getWrapperData ()
 
 isConsumed ()
 
 isLocal ()
 
 isReadable ()
 
 isRepeatable ()
 
 isSeekable ()
 
 isWritable ()
 
 read ($length)
 
 readLine ($maxLength=null)
 
 rewind ()
 
 seek ($offset, $whence=SEEK_SET)
 
 setCustomData ($key, $value)
 
 setSize ($size)
 
 setStream ($stream, $size=null)
 
 write ($string)
 

Detailed Description

Entity body used with an HTTP request or response

Definition at line 10 of file EntityBodyInterface.php.

Member Function Documentation

◆ compress()

Guzzle\Http\EntityBodyInterface::compress (   $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.

Parameters
string$filterCompression filter
Returns
bool Returns TRUE on success or FALSE on failure

Implemented in Guzzle\Http\EntityBody, and Guzzle\Http\AbstractEntityBodyDecorator.

◆ getContentEncoding()

Guzzle\Http\EntityBodyInterface::getContentEncoding ( )

Get the Content-Encoding of the EntityBody

Returns
bool|string

Implemented in Guzzle\Http\CachingEntityBody, Guzzle\Http\EntityBody, and Guzzle\Http\AbstractEntityBodyDecorator.

◆ getContentLength()

Guzzle\Http\EntityBodyInterface::getContentLength ( )

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

Returns
int|bool Returns the Content-Length or false on failure

Implemented in Guzzle\Http\EntityBody, Guzzle\Http\AbstractEntityBodyDecorator, and Guzzle\Http\ReadLimitEntityBody.

◆ getContentMd5()

Guzzle\Http\EntityBodyInterface::getContentMd5 (   $rawOutput = false,
  $base64Encode = false 
)

Get an MD5 checksum of the stream's contents

Parameters
bool$rawOutputWhether or not to use raw output
bool$base64EncodeWhether or not to base64 encode raw output (only if raw output is true)
Returns
bool|string Returns an MD5 string on success or FALSE on failure

Implemented in Guzzle\Http\EntityBody, and Guzzle\Http\AbstractEntityBodyDecorator.

Referenced by Guzzle\Http\EntityBody\calculateMd5(), and Guzzle\Plugin\Cache\DefaultCacheStorage\getBodyKey().

◆ getContentType()

Guzzle\Http\EntityBodyInterface::getContentType ( )

Guess the Content-Type of a local stream

Returns
string|null
See also
http://www.php.net/manual/en/function.finfo-open.php

Implemented in Guzzle\Http\CachingEntityBody, Guzzle\Http\EntityBody, and Guzzle\Http\AbstractEntityBodyDecorator.

◆ setRewindFunction()

Guzzle\Http\EntityBodyInterface::setRewindFunction (   $callable)

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

Parameters
mixed$callableCallable 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
self

Implemented in Guzzle\Http\CachingEntityBody, Guzzle\Http\EntityBody, and Guzzle\Http\AbstractEntityBodyDecorator.

◆ uncompress()

Guzzle\Http\EntityBodyInterface::uncompress (   $filter = 'zlib.inflate')

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

Parameters
string$filterDe-compression filter
Returns
bool Returns TRUE on success or FALSE on failure

Implemented in Guzzle\Http\EntityBody, and Guzzle\Http\AbstractEntityBodyDecorator.


The documentation for this interface was generated from the following file: