Docs For Class EasyRdf_Http_Client

## 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.

- copyright: Copyright (c) 2009-2010 Nicholas J Humfrey
- license: http://www.opensource.org/licenses/bsd-license.php

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 ()
int getRedirectionsCount ()
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 233)

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 219)

Get the method for the next request

- access: public

string getMethod ()
getParameterGet (line 268)

Get a GET parameter for the request.

- return: value
- access: public

string getParameterGet (string $name)

- string $name

getParametersGet (line 282)

Get all the GET parameters

- access: public

array getParametersGet ()
getRawData (line 321)

Get the raw (already encoded) POST data.

- access: public

string getRawData ()
getRedirectionsCount (line 292)

Get the number of redirections done on the last request

- access: public

int getRedirectionsCount ()
getUri (line 144)

Get the URI for the next request

- access: public

string getUri ([ $asString = true])

- $asString

request (line 366)

Send the HTTP request and return an HTTP response object

- throws: EasyRdf_Exception
- access: public

EasyRdf_Http_Response request ([ $method = null])

- $method

resetParameters (line 338)

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 156)

Set configuration parameters for this HTTP client

- throws: InvalidArgumentException
- access: public

EasyRdf_Http_Client setConfig ([array $config = array()])

- array $config

setHeaders (line 178)

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 203)

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 250)

Set a GET parameter for the request.

- access: public

EasyRdf_Http_Client setParameterGet (string $name, [string $value = null])

- string $name
- string $value

setRawData (line 310)

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, 20 Jul 2011 19:54:03 +0100 by phpDocumentor 1.4.3