Class EasyRdf_Http_Client

Description

This class is an implemetation of an HTTP client in PHP.

It supports basic HTTP 1.0 and 1.1 requests. For a more complete implementation try Zend_Http_Client.

Located in /EasyRdf/Http/Client.php (line 50)


	
			
Method Summary
EasyRdf_Http_Client __construct ([string $uri = null], [array $config = null])
string|array|null getHeader (string $key)
string getMethod ()
string getParameterGet (string $name)
array getParametersGet ()
string getRawData ()
string getUri ([ $asString = true])
EasyRdf_Http_Response request ([ $method = null])
EasyRdf_Http_Client resetParameters ([bool $clearAll = false])
EasyRdf_Http_Client setConfig ([array $config = array()])
EasyRdf_Http_Client setHeaders (string $name, [string $value = null])
EasyRdf_Http_Client setMethod (string $method)
EasyRdf_Http_Client setParameterGet (string $name, [string $value = null])
Zend_Http_Client setRawData (string|resource $data)
EasyRdf_Http_Client setUri (string $uri)
Methods
Constructor __construct (line 112)

Constructor method. Will create a new HTTP client. Accepts the target URL and optionally configuration array.

  • access: public
EasyRdf_Http_Client __construct ([string $uri = null], [array $config = null])
  • string $uri
  • array $config: Configuration key-value pairs.
getHeader (line 239)

Get the value of a specific header

Note that if the header has more than one value, an array will be returned.

  • return: The header value or null if it is not set
  • access: public
string|array|null getHeader (string $key)
  • string $key
getMethod (line 225)

Get the method for the next request

  • access: public
string getMethod ()
getParameterGet (line 274)

Get a GET parameter for the request.

  • return: value
  • access: public
string getParameterGet (string $name)
  • string $name
getParametersGet (line 288)

Get all the GET parameters

  • access: public
array getParametersGet ()
getRawData (line 327)

Get the raw (already encoded) POST data.

  • access: public
string getRawData ()
getRedirectionsCount (line 298)

Get the number of redirections done on the last request

  • access: public
int getRedirectionsCount ()
getUri (line 150)

Get the URI for the next request

  • access: public
string getUri ([ $asString = true])
  • $asString
request (line 372)

Send the HTTP request and return an HTTP response object

  • throws: EasyRdf_Exception
  • access: public
EasyRdf_Http_Response request ([ $method = null])
  • $method
resetParameters (line 344)

Clear all GET and POST parameters

Should be used to reset the request parameters if the client is used for several concurrent requests.

clearAll parameter controls if we clean just parameters or also headers

  • access: public
EasyRdf_Http_Client resetParameters ([bool $clearAll = false])
  • bool $clearAll: Should all data be cleared?
setConfig (line 162)

Set configuration parameters for this HTTP client

  • throws: InvalidArgumentException
  • access: public
EasyRdf_Http_Client setConfig ([array $config = array()])
  • array $config
setHeaders (line 184)

Set a request header

  • access: public
EasyRdf_Http_Client setHeaders (string $name, [string $value = null])
  • string $name: Header name (e.g. 'Accept')
  • string $value: Header value or null
setMethod (line 209)

Set the next request's method

Validated the passed method and sets it.

  • throws: InvalidArgumentException
  • access: public
EasyRdf_Http_Client setMethod (string $method)
  • string $method
setParameterGet (line 256)

Set a GET parameter for the request.

  • access: public
EasyRdf_Http_Client setParameterGet (string $name, [string $value = null])
  • string $name
  • string $value
setRawData (line 316)

Set the raw (already encoded) POST data.

This function is here for two reasons:

  1. For advanced user who would like to set their own data, already encoded
  2. For backwards compatibilty: If someone uses the old post($data) method. this method will be used to set the encoded data.
$data can also be stream (such as file) from which the data will be read.

  • access: public
Zend_Http_Client setRawData (string|resource $data)
  • string|resource $data
setUri (line 128)

Set the URI for the next request

  • access: public
EasyRdf_Http_Client setUri (string $uri)
  • string $uri

Documentation generated on Wed, 16 Jan 2013 19:16:37 +0000 by phpDocumentor 1.4.4