TYPO3  7.6
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
HTTP_Request2_Response Class Reference

Public Member Functions

 __construct ($statusLine, $bodyEncoded=true, $effectiveUrl=null)
 
 parseHeaderLine ($headerLine)
 
 appendBody ($bodyChunk)
 
 getEffectiveUrl ()
 
 getStatus ()
 
 getReasonPhrase ()
 
 isRedirect ()
 
 getHeader ($headerName=null)
 
 getCookies ()
 
 getBody ()
 
 getVersion ()
 

Static Public Member Functions

static getDefaultReasonPhrase ($code=null)
 
static decodeGzip ($data)
 
static decodeDeflate ($data)
 

Protected Member Functions

 parseCookie ($cookieString)
 

Protected Attributes

 $version
 
 $code
 
 $reasonPhrase
 
 $effectiveUrl
 
 $headers = array()
 
 $cookies = array()
 
 $lastHeader = null
 
 $body = ''
 
 $bodyEncoded
 

Static Protected Attributes

static $phrases
 

Detailed Description

Definition at line 54 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

Constructor & Destructor Documentation

__construct (   $statusLine,
  $bodyEncoded = true,
  $effectiveUrl = null 
)

Constructor, parses the response status line

Parameters
string$statusLineResponse status line (e.g. "HTTP/1.1 200 OK")
bool$bodyEncodedWhether body is still encoded by Content-Encoding
string$effectiveUrlEffective URL of the response
Exceptions
HTTP_Request2_MessageExceptionif status line is invalid according to spec

Definition at line 212 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $bodyEncoded, $effectiveUrl, and HTTP_Request2_Exception\MALFORMED_RESPONSE.

Member Function Documentation

appendBody (   $bodyChunk)

Appends a string to the response body

Parameters
string$bodyChunkpart of response body

Definition at line 339 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

static decodeDeflate (   $data)
static

Decodes the message-body encoded by deflate

Parameters
string$datadeflate-encoded data
Returns
string decoded data
Exceptions
HTTP_Request2_LogicException

Definition at line 615 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References HTTP_Request2_Exception\MISCONFIGURATION.

static decodeGzip (   $data)
static

Decodes the message-body encoded by gzip

The real decoding work is done by gzinflate() built-in function, this method only parses the header and checks data for compliance with RFC 1952

Parameters
string$datagzip-encoded data
Returns
string decoded data
Exceptions
HTTP_Request2_LogicException
HTTP_Request2_MessageExceptionhttp://tools.ietf.org/html/rfc1952

Definition at line 481 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References HTTP_Request2_Exception\DECODE_ERROR, elseif, and HTTP_Request2_Exception\MISCONFIGURATION.

getBody ( )

Returns the body of the response

Returns
string
Exceptions
HTTP_Request2_Exceptionif body cannot be decoded

Definition at line 423 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $body, and getHeader().

getCookies ( )

Returns cookies set in response

Returns
array

Definition at line 412 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $cookies.

Referenced by HTTP_Request2_CookieJar\addCookiesFromResponse().

static getDefaultReasonPhrase (   $code = null)
static

Returns the default reason phrase for the given code or all reason phrases

Parameters
int$codeResponse code
Returns
string|array|null Default reason phrase for $code if $code is given (null if no phrase is available), array of all reason phrases if $code is null http://pear.php.net/bugs/18716

Definition at line 194 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $code.

getEffectiveUrl ( )

Returns the effective URL of the response

This may be different from the request URL if redirects were followed.

Returns
string http://pear.php.net/bugs/bug.php?id=18412

Definition at line 352 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $effectiveUrl.

getHeader (   $headerName = null)

Returns either the named header or all response headers

Parameters
string$headerNameName of header to return
Returns
string|array Value of $headerName header (null if header is not present), array of all response headers if $headerName is null

Definition at line 397 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $headers.

Referenced by HTTP_Request2_Adapter_Socket\canKeepAlive(), Download\determineFilename(), getBody(), HTTP_Request2_Adapter_Socket\handleRedirect(), HTTP_Request2_Adapter_Socket\shouldUseProxyDigestAuth(), and HTTP_Request2_Adapter_Socket\shouldUseServerDigestAuth().

getReasonPhrase ( )

Returns the reason phrase

Returns
string

Definition at line 372 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $reasonPhrase.

getStatus ( )
getVersion ( )

Get the HTTP version of the response

Returns
string

Definition at line 462 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $version.

Referenced by HTTP_Request2_Adapter_Socket\canKeepAlive().

isRedirect ( )

Whether response is a redirect that can be automatically handled by HTTP_Request2

Returns
bool

Definition at line 382 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

parseCookie (   $cookieString)
protected

Parses a Set-Cookie header to fill $cookies array

Parameters
string$cookieStringvalue of Set-Cookie header

http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html

Definition at line 290 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References elseif.

Referenced by parseHeaderLine().

parseHeaderLine (   $headerLine)

Parses the line from HTTP response filling $headers array

The method should be called after reading the line from socket or receiving it into cURL callback. Passing an empty string here indicates the end of response headers and triggers additional processing, so be sure to pass an empty string in the end.

Parameters
string$headerLineLine from HTTP response

Definition at line 237 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

References $cookies, $lastHeader, elseif, and parseCookie().

Member Data Documentation

$body = ''
protected

Definition at line 107 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

Referenced by getBody().

$bodyEncoded
protected

Definition at line 117 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

Referenced by __construct().

$code
protected
$cookies = array()
protected
$effectiveUrl
protected
$headers = array()
protected

Definition at line 86 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

Referenced by getHeader().

$lastHeader = null
protected
$phrases
staticprotected
$reasonPhrase
protected
$version
protected

Definition at line 60 of file vendor/pear/http_request2/HTTP/Request2/Response.php.

Referenced by getVersion().