class EasyRdf_Http_Client
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 ZendHttpClient.
Methods
__construct(string $uri = null, array $config = null)
Constructor method. |
||
EasyRdf_Http_Client |
setUri(string $uri)
Set the URI for the next request |
|
string |
getUri($asString = true)
Get the URI for the next request |
|
EasyRdf_Http_Client |
setConfig(array $config = array())
Set configuration parameters for this HTTP client |
|
EasyRdf_Http_Client |
setHeaders(string $name, string $value = null)
Set a request header |
|
EasyRdf_Http_Client |
setMethod(string $method)
Set the next request's method |
|
string |
getMethod()
Get the method for the next request |
|
string|array|null |
getHeader(string $key)
Get the value of a specific header |
|
EasyRdf_Http_Client |
setParameterGet(string $name, string $value = null)
Set a GET parameter for the request. |
|
string |
getParameterGet(string $name)
Get a GET parameter for the request. |
|
array |
getParametersGet()
Get all the GET parameters |
|
int |
getRedirectionsCount()
Get the number of redirections done on the last request |
|
Zend_Http_Client |
setRawData(string|resource $data)
Set the raw (already encoded) POST data. |
|
string |
getRawData()
Get the raw (already encoded) POST data. |
|
EasyRdf_Http_Client |
resetParameters(bool $clearAll = false)
Clear all GET and POST parameters |
|
EasyRdf_Http_Response |
request($method = null)
Send the HTTP request and return an HTTP response object |
Details
at line 111
public
__construct(string $uri = null, array $config = null)
Constructor method.
Will create a new HTTP client. Accepts the target URL and optionally configuration array.
at line 127
public EasyRdf_Http_Client
setUri(string $uri)
Set the URI for the next request
at line 149
public string
getUri($asString = true)
Get the URI for the next request
at line 161
public EasyRdf_Http_Client
setConfig(array $config = array())
Set configuration parameters for this HTTP client
at line 183
public EasyRdf_Http_Client
setHeaders(string $name, string $value = null)
Set a request header
at line 207
public EasyRdf_Http_Client
setMethod(string $method)
Set the next request's method
Validated the passed method and sets it.
at line 223
public string
getMethod()
Get the method for the next request
at line 237
public string|array|null
getHeader(string $key)
Get the value of a specific header
Note that if the header has more than one value, an array will be returned.
at line 254
public EasyRdf_Http_Client
setParameterGet(string $name, string $value = null)
Set a GET parameter for the request.
at line 273
public string
getParameterGet(string $name)
Get a GET parameter for the request.
at line 287
public array
getParametersGet()
Get all the GET parameters
at line 297
public int
getRedirectionsCount()
Get the number of redirections done on the last request
at line 315
public Zend_Http_Client
setRawData(string|resource $data)
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.
at line 326
public string
getRawData()
Get the raw (already encoded) POST data.
at line 343
public EasyRdf_Http_Client
resetParameters(bool $clearAll = false)
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
at line 371
public EasyRdf_Http_Response
request($method = null)
Send the HTTP request and return an HTTP response object