Class php_http_client_generic

Description

An HTTP Request class

Located in /includes/domit/php_http_client_generic.php (line 136)

php_http_request
   |
   --php_http_client_generic
Direct descendents
Class Description
dom_xmlrpc_client Provides basic XML-RPC client functionality
php_http_proxy An HTTP Proxy class
Variable Summary
object A $connection
string $events
object The $response
Method Summary
php_http_client_generic php_http_client_generic ([string $host = ''], [string $path = '/'], [int $port = 80], int $timeout)
void connect ()
string decodeChunkedData (string $data)
void defaultHTTPEventHandler (string $data)
void disconnect ()
void fireEvent (string $target, string $data)
void generateResponseHeadersAsObject (boolean $responseHeadersAsObject)
object An &get (string $url)
boolean getHTTPEvent (string $option)
void get_custom (string $url)
object An &head (string $url)
void head_custom (string $url)
boolean isConnected ()
object An &post (string $data)
void post_custom (string $data)
void printHTML (string $html)
string &send (string $message)
void setHTTPEvent (string $option, string $truthVal, [object A $customHandler = null])
Variables
object A $connection (line 138)
  • var: reference to the connection object
string $events = array('onRequest' => null, 'onRead' => null,
'onResponse' => null, 'onResponseHeaders' => null,
'onResponseBody' => null)
(line 144)
  • var: A list of event names that can be fired by the client
object The $response = null (line 142)
  • var: http response
string $responseHeadersAsObject = false (line 140)
  • var: True if response headers are to be generated as an object

Inherited Variables

Inherited from php_http_request

php_http_request::$headers
php_http_request::$protocol
php_http_request::$protocolVersion
php_http_request::$requestMethod
php_http_request::$requestPath
Methods
Constructor php_http_client_generic (line 155)

HTTP Client constructor

php_http_client_generic php_http_client_generic ([string $host = ''], [string $path = '/'], [int $port = 80], int $timeout)
  • string $host: The client connection host name, with or without its protocol prefix
  • string $path: The client connection path, not including the host name
  • int $port: The port to establish the client connection on
  • int $timeout: The timeout value for the client connection
connect (line 247)

Establishes a client connection

void connect ()
decodeChunkedData (line 442)

Decodes data if transfer encoding chunked

  • return: The decoded data
string decodeChunkedData (string $data)
  • string $data: The encoded data
defaultHTTPEventHandler (line 232)

The default http event handler; fired if no custom handler has been registered

void defaultHTTPEventHandler (string $data)
  • string $data: The event data
disconnect (line 258)

Disconnects the current client connection if one exists

void disconnect ()
fireEvent (line 180)

Fires an http event that has been registered

void fireEvent (string $target, string $data)
  • string $target: The name of the event, e.g., onRead
  • string $data: The data to be passed to the event
generateResponseHeadersAsObject (line 167)

Specifies that the response headers array should be generated

void generateResponseHeadersAsObject (boolean $responseHeadersAsObject)
  • boolean $responseHeadersAsObject: True if the response headers array should be built
get (line 275)

Performs an HTTP GET

  • return: HTTP response object
object An &get (string $url)
  • string $url: The target url
getHTTPEvent (line 216)

Evaluates whether the specified http event option is active

  • return: True if the specified option is active
boolean getHTTPEvent (string $option)
  • string $option: The http event option to evaluate
get_custom (line 292)

Handler for customizing the HTTP GET call

void get_custom (string $url)
  • string $url: The target url

Redefined in descendants as:
head (line 324)

Performs an HTTP HEAD

  • return: HTTP response object
object An &head (string $url)
  • string $url: The target url
head_custom (line 337)

Handler for customizing the HTTP HEAD call

void head_custom (string $url)
  • string $url: The target url
isConnected (line 266)

Evaluated whether the current client is connected

  • return: True if a connection exists
boolean isConnected ()
normalizeResponseIfChunked (line 418)

Determines if response data is transfer encoding chunked, then decodes

void normalizeResponseIfChunked ()
post (line 301)

Performs an HTTP POST

  • return: HTTP response object
object An &post (string $data)
  • string $data: The posted data
post_custom (line 315)

Handler for customizing the HTTP POST call

void post_custom (string $data)
  • string $data: The post data
printHTML (line 240)

Prints the data to the browser as preformatted, htmlentified output

void printHTML (string $html)
  • string $html: The data to be printed
send (line 346)

Sends data through the client connection

  • return: The http response
string &send (string $message)
  • string $message: The message to be sent

Redefined in descendants as:
setHTTPEvent (line 192)

Sets which http events are to be fired

void setHTTPEvent (string $option, string $truthVal, [object A $customHandler = null])
  • string $option: The http event option to be set
  • string $truthVal: True if the event is to be fired
  • object A $customHandler: reference to a custom handler for the http event data

Inherited Methods

Inherited From php_http_request

php_http_request::getHeaders()
php_http_request::setAuthorization()
php_http_request::setHeader()
php_http_request::setHeaders()
php_http_request::setProtocolVersion()
php_http_request::setRequestMethod()
php_http_request::setRequestPath()

Documentation generated on Fri, 4 Mar 2005 13:57:03 +1000 by phpDocumentor 1.3.0RC3