Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • AbstractEntityBodyDecorator
  • CachingEntityBody
  • Client
  • EntityBody
  • IoEmittingEntityBody
  • Mimetypes
  • QueryString
  • ReadLimitEntityBody
  • RedirectPlugin
  • StaticClient
  • Url

Interfaces

  • ClientInterface
  • EntityBodyInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class EntityBody

Entity body used with an HTTP request or response

Guzzle\Stream\Stream implements Guzzle\Stream\StreamInterface
Extended by Guzzle\Http\EntityBody implements Guzzle\Http\EntityBodyInterface
Namespace: Guzzle\Http
Located at src/Guzzle/Http/EntityBody.php
Methods summary
public static Guzzle\Http\EntityBody
# factory( resource|string|Guzzle\Http\EntityBody $resource = '', integer $size = null )

Create a new EntityBody based on the input type

Create a new EntityBody based on the input type

Parameters

$resource
Entity body data
$size
Size of the data contained in the resource

Returns

Guzzle\Http\EntityBody

Throws

InvalidArgumentException
if the $resource arg is not a resource or string
public Guzzle\Http\EntityBody
# setRewindFunction( mixed $callable )

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

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

Parameters

$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

Guzzle\Http\EntityBody

Implementation of

Guzzle\Http\EntityBodyInterface::setRewindFunction()
public boolean
# rewind( )

Rewind to the beginning of the stream

Rewind to the beginning of the stream

Returns

boolean
Returns true on success or false on failure

Overrides

Guzzle\Stream\Stream::rewind()

Implementation of

Guzzle\Stream\StreamInterface::rewind()
public static Guzzle\Http\EntityBody
# fromString( string $string )

Create a new EntityBody from a string

Create a new EntityBody from a string

Parameters

$string
String of data

Returns

Guzzle\Http\EntityBody
public boolean
# compress( 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.

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
Compression filter

Returns

boolean
Returns TRUE on success or FALSE on failure

Implementation of

Guzzle\Http\EntityBodyInterface::compress()
public boolean
# uncompress( string $filter = 'zlib.inflate' )

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

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

Parameters

$filter
De-compression filter

Returns

boolean
Returns TRUE on success or FALSE on failure

Implementation of

Guzzle\Http\EntityBodyInterface::uncompress()
public integer|boolean
# getContentLength( )

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

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

Returns

integer|boolean
Returns the Content-Length or false on failure

Implementation of

Guzzle\Http\EntityBodyInterface::getContentLength()
public string|null
# getContentType( )

Guess the Content-Type of a local stream

Guess the Content-Type of a local stream

Returns

string|null

See

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

Implementation of

Guzzle\Http\EntityBodyInterface::getContentType()
public boolean|string
# getContentMd5( boolean $rawOutput = false, boolean $base64Encode = false )

Get an MD5 checksum of the stream's contents

Get an MD5 checksum of the stream's contents

Parameters

$rawOutput
Whether or not to use raw output
$base64Encode
Whether or not to base64 encode raw output (only if raw output is true)

Returns

boolean|string
Returns an MD5 string on success or FALSE on failure

Implementation of

Guzzle\Http\EntityBodyInterface::getContentMd5()
public static boolean|string
# calculateMd5( Guzzle\Http\EntityBodyInterface $body, boolean $rawOutput = false, boolean $base64Encode = false )

Calculate the MD5 hash of an entity body

Calculate the MD5 hash of an entity body

Deprecated

This will be deprecated soon

Parameters

$body
Entity body to calculate the hash for
$rawOutput
Whether or not to use raw output
$base64Encode
Whether or not to base64 encode raw output (only if raw output is true)

Returns

boolean|string
Returns an MD5 string on success or FALSE on failure

Codecoverageignore

public
# setStreamFilterContentEncoding( $streamFilterContentEncoding )
public boolean|string
# getContentEncoding( )

Get the Content-Encoding of the EntityBody

Get the Content-Encoding of the EntityBody

Returns

boolean|string

Implementation of

Guzzle\Http\EntityBodyInterface::getContentEncoding()
protected
# handleCompression( $filter, $offsetStart = 0 )
Methods inherited from Guzzle\Stream\Stream
__construct(), __destruct(), __toString(), close(), detachStream(), feof(), ftell(), getCustomData(), getHash(), getMetaData(), getSize(), getStream(), getStreamType(), getUri(), getWrapper(), getWrapperData(), isConsumed(), isLocal(), isReadable(), isRepeatable(), isSeekable(), isWritable(), read(), readLine(), rebuildCache(), seek(), setCustomData(), setSize(), setStream(), write()
Constants inherited from Guzzle\Stream\Stream
IS_LOCAL, IS_READABLE, IS_WRITABLE, SEEKABLE, STREAM_TYPE, WRAPPER_TYPE
Properties summary
protected boolean $contentEncoding

Content-Encoding of the entity body if known

Content-Encoding of the entity body if known

# false
protected callable $rewindFunction

Method to invoke for rewinding a stream

Method to invoke for rewinding a stream

#
Properties inherited from Guzzle\Stream\Stream
$cache, $customData, $readWriteHash, $size, $stream
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen