Properties

$httpMethodOverride

$httpMethodOverride : boolean

@see $_httpMethodOverride

Type

boolean

$request

$request : \Horde_Http_Request_Base

A concrete request instance.

Type

\Horde_Http_Request_Base

$request.uri

$request.uri : string|\Horde_Url

Default URI if not specified for individual requests.

Type

string|\Horde_Url

$request.headers

$request.headers : array

Hash with additional request headers.

Type

array

$request.method

$request.method : string

Default request method if not specified for individual requests.

Type

string

$request.data

$request.data : array|string

POST data fields or POST/PUT data body.

Type

array|string

$request.username

$request.username : string

Authentication user name.

Type

string

$request.password

$request.password : string

Authentication password.

Type

string

$request.authenticationScheme

$request.authenticationScheme : string

Authentication method, one of the HordeHttp::AUTH* constants.

Type

string

$request.proxyServer

$request.proxyServer : string

Host name of a proxy server.

Type

string

$request.proxyPort

$request.proxyPort : integer

Port number of a proxy server.

Type

integer

$request.proxyType

$request.proxyType : integer

Proxy server type, one of the HordeHttp::PROXY* constants.

Type

integer

$request.proxyUsername

$request.proxyUsername : string

Proxy authentication user name.

Type

string

$request.proxyPassword

$request.proxyPassword : string

Proxy authentication password.

Type

string

$request.proxyAuthenticationScheme

$request.proxyAuthenticationScheme : string

Proxy authentication method, one of the HordeHttp::AUTH* constants.

Type

string

$request.redirects

$request.redirects : integer

Maximum number of redirects to follow.

Type

integer

$request.timeout

$request.timeout : integer

Timeout in seconds.

Type

integer

$request.verifyPeer

$request.verifyPeer : boolean

Verify SSL peer certificates?

Type

boolean

$_httpMethodOverride

$_httpMethodOverride : boolean

Use POST instead of PUT and DELETE, sending X-HTTP-Method-Override with the intended method name instead.

Type

boolean

Methods

__construct()

__construct(array  $args = array()) 

Horde_Http_Client constructor.

Parameters

array $args

Any Http_Client settings to initialize in the constructor. See the class properties for available settings.

get()

get(string  $uri = null, array  $headers = array()) : \Horde_Http_Response_Base

Sends a GET request.

Parameters

string $uri

Request URI.

array $headers

Additional request headers.

Throws

\Horde_Http_Exception

Returns

\Horde_Http_Response_Base

post()

post(string  $uri = null, array|string  $data = null, array  $headers = array()) : \Horde_Http_Response_Base

Sends a POST request.

Parameters

string $uri

Request URI.

array|string $data

Data fields or data body.

array $headers

Additional request headers.

Throws

\Horde_Http_Exception

Returns

\Horde_Http_Response_Base

put()

put(string  $uri = null, string  $data = null, array  $headers = array()) : \Horde_Http_Response_Base

Sends a PUT request.

Parameters

string $uri

Request URI.

string $data

Data body.

array $headers

Additional request headers.

Throws

\Horde_Http_Exception

Returns

\Horde_Http_Response_Base

delete()

delete(string  $uri = null, array  $headers = array()) : \Horde_Http_Response_Base

Sends a DELETE request.

Parameters

string $uri

Request URI.

array $headers

Additional request headers.

Throws

\Horde_Http_Exception

Returns

\Horde_Http_Response_Base

head()

head(string  $uri = null, array  $headers = array()) : \Horde_Http_Response_Base

Sends a HEAD request.

Parameters

string $uri

Request URI.

array $headers

Additional request headers.

Throws

\Horde_Http_Exception

Returns

\Horde_Http_Response_Base

request()

request(string  $method, string|\Horde_Url  $uri = null, string|array  $data = null, array  $headers = array()) : \Horde_Http_Response_Base

Sends an HTTP request.

Parameters

string $method

HTTP request method (GET, PUT, etc.)

string|\Horde_Url $uri

URI to request, if different from $this->uri

string|array $data

Request data. Array of form data that will be encoded automatically, or a raw string.

array $headers

Any headers specific to this request. They will be combined with $this->_headers, and override headers of the same name for this request only.

Throws

\Horde_Http_Exception

Returns

\Horde_Http_Response_Base

__get()

__get(string  $name) : mixed

Returns a client parameter.

Parameters

string $name

The parameter to return.

Returns

mixed —

The parameter value.

__set()

__set(string  $name, mixed  $value) 

Sets a client parameter.

Parameters

string $name

The parameter to set.

mixed $value

The parameter value.