Class SimpleHttpRequest

Description

HTTP request for a web page. Factory for HttpResponse object.

Located in /libraries/pear/simpletest/http.php (line 398)


	
			
Direct descendents
Class Description
 class SimpleHttpPostRequest Request with data to send. Usually PUT or POST.
Variable Summary
 mixed $_content
 mixed $_cookies
 mixed $_headers
 mixed $_method
 mixed $_route
Method Summary
 SimpleHttpRequest SimpleHttpRequest (SimpleRoute &$route, string $method, [string $content = ''])
 void addHeaderLine (string $header_line)
 SimpleHttpResponse &fetch (integer $timeout)
 void setCookie (SimpleCookie $cookie)
 void _dispatchRequest (SimpleSocket &$socket, string $method, string $content)
 array _marshallCookies (hash $cookies)
Variables
mixed $_content (line 401)
mixed $_cookies (line 403)
mixed $_headers (line 402)
mixed $_method (line 400)
mixed $_route (line 399)
Methods
Constructor SimpleHttpRequest (line 413)

Saves the URL ready for fetching.

  • access: public
SimpleHttpRequest SimpleHttpRequest (SimpleRoute &$route, string $method, [string $content = ''])
  • SimpleRoute $route: Request route.
  • string $method: HTTP request method, usually GET.
  • string $content: Content to send with request.
addHeaderLine (line 467)

Adds a header line to the request.

  • access: public
void addHeaderLine (string $header_line)
  • string $header_line: Text of header line.
fetch (line 428)

Fetches the content and parses the headers.

  • return: A response which may only have an error.
  • access: public
SimpleHttpResponse &fetch (integer $timeout)
  • integer $timeout: Connection timeout.
setCookie (line 476)

Adds a cookie to the request.

  • access: public
void setCookie (SimpleCookie $cookie)
_createResponse (line 501)

Wraps the socket in a response parser.

  • return: Parsed response object.
  • access: protected
SimpleHttpResponse &_createResponse (SimpleSocket &$socket)
_dispatchRequest (line 445)

Sends the headers.

  • access: protected
void _dispatchRequest (SimpleSocket &$socket, string $method, string $content)
  • SimpleSocket $socket: Open socket.
  • string $method: HTTP request method, usually GET.
  • string $content: Content to send with request.

Redefined in descendants as:
_marshallCookies (line 487)

Serialises the cookie hash ready for transmission.

  • return: Cookies in header form.
  • access: private
array _marshallCookies (hash $cookies)
  • hash $cookies: Parsed cookies.

Documentation generated on Fri, 3 Dec 2004 12:26:47 +0000 by phpDocumentor 1.3.0RC3