Class SimpleHttpResponse

Description

Basic HTTP response.

Located in /http.php (line 482)

SimpleStickyError
   |
   --SimpleHttpResponse
Method Summary
 SimpleHttpResponse __construct (SimpleSocket $socket, SimpleUrl $url, mixed $encoding)
 string getContent ()
 SimpleHeaders getHeaders ()
 string getMethod ()
 array getNewCookies ()
 mixed getRequestData ()
 string getSent ()
 boolean isLastPacket (string $packet)
 void parse (string $raw)
 string readAll (SimpleSocket $socket)
Methods
Constructor __construct (line 498)

Constructor. Reads and parses the incoming content and headers.

  • access: public
SimpleHttpResponse __construct (SimpleSocket $socket, SimpleUrl $url, mixed $encoding)
  • SimpleSocket $socket: Network connection to fetch response text from.
  • SimpleUrl $url: Resource name.
  • mixed $encoding: Record of content sent.

Redefinition of:
SimpleStickyError::__construct()
Sets the error to empty.
getContent (line 575)

Accessor for the content after the last header line.

  • return: All content.
  • access: public
string getContent ()
getHeaders (line 585)

Accessor for header block. The response is the combination of this and the content.

  • return: Wrapped header block.
  • access: public
SimpleHeaders getHeaders ()
getMethod (line 538)

Original request method.

  • return: GET, POST or HEAD.
  • access: public
string getMethod ()
getNewCookies (line 594)

Accessor for any new cookies.

  • return: List of new cookies.
  • access: public
array getNewCookies ()
getRequestData (line 556)

Original request data.

  • return: Sent content.
  • access: public
mixed getRequestData ()
getSent (line 565)

Raw request that was sent down the wire.

  • return: Bytes actually sent.
  • access: public
string getSent ()
getUrl (line 547)

Resource name.

  • return: Current url.
  • access: public
SimpleUrl getUrl ()
isLastPacket (line 621)

Test to see if the packet from the socket is the last one.

  • return: True if empty or EOF.
  • access: protected
boolean isLastPacket (string $packet)
  • string $packet: Chunk to interpret.
parse (line 517)

Splits up the headers and the rest of the content.

  • access: protected
void parse (string $raw)
  • string $raw: Content to parse.
readAll (line 606)

Reads the whole of the socket output into a single string.

  • return: Raw output if successful else false.
  • access: protected
string readAll (SimpleSocket $socket)

Inherited Methods

Inherited From SimpleStickyError

 SimpleStickyError::__construct()
 SimpleStickyError::clearError()
 SimpleStickyError::getError()
 SimpleStickyError::isError()
 SimpleStickyError::setError()

Documentation generated on Sun, 31 Oct 2010 16:31:38 -0500 by phpDocumentor 1.4.3