default
[ class tree: default ] [ index: default ] [ all elements ]

Class: HTTP_Response

Source Location: /pear/HTTP/Request.php

Class Overview


Response class to complement the Request class


Variables

Methods



Class Details

[line 1019]
Response class to complement the Request class



[ Top ]


Class Variables

$_body =  ''

[line 1055]

Response body


Type:   string


[ Top ]

$_chunkLength =  0

[line 1061]

Used by _readChunked(): remaining length of the current chunk


Type:   string


[ Top ]

$_code =

[line 1037]

Return code


Type:   string


[ Top ]

$_cookies =

[line 1049]

Cookies set in response


Type:   array


[ Top ]

$_headers =

[line 1043]

Response headers


Type:   array


[ Top ]

$_listeners = array()

[line 1067]

Attached listeners


Type:   array


[ Top ]

$_protocol =

[line 1031]

Protocol


Type:   string


[ Top ]

$_sock =

[line 1025]

Socket object


Type:   object


[ Top ]

$_toRead =

[line 1073]

Bytes left to read from message-body


Type:   null|int


[ Top ]



Class Methods


constructor HTTP_Response [line 1082]

mixed HTTP_Response( object Net_Socket &$sock, array &$listeners)

Constructor



Tags:

return:  PEAR Error on error, true otherwise


Parameters:

object Net_Socket   &$sock   socket to read the response from
array   &$listeners   listeners attached to request

[ Top ]

method process [line 1104]

mixed process( [bool $saveBody = true], [bool $canHaveBody = true])

Processes a HTTP response

This extracts response code, headers, cookies and decodes body if it was encoded in some way




Tags:

return:  true on success, PEAR_Error in case of malformed response
throws:  PEAR_Error
access:  public


Parameters:

bool   $saveBody   Whether to store response body in object property, set this to false if downloading a LARGE file and using a Listener. This is assumed to be true if body is gzip-encoded.
bool   $canHaveBody   Whether the response can actually have a message-body. Will be set to false for HEAD requests.

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:59 +0100 by phpDocumentor 1.4.3