Documentation

Horde_Http_Client
in package

An HTTP client.

Tags
author

Chuck Hagenbuch chuck@horde.org

category

Horde

copyright

2007-2017 Horde LLC

license

http://www.horde.org/licenses/bsd BSD

Table of Contents

$httpMethodOverride  : bool
$request  : Horde_Http_Request_Base
$request.authenticationScheme  : string
$request.data  : array<string|int, mixed>|string
$request.headers  : array<string|int, mixed>
$request.method  : string
$request.password  : string
$request.proxyAuthenticationScheme  : string
$request.proxyPassword  : string
$request.proxyPort  : int
$request.proxyServer  : string
$request.proxyType  : int
$request.proxyUsername  : string
$request.redirects  : int
$request.timeout  : int
$request.uri  : string|Horde_Url
$request.username  : string
$request.verifyPeer  : bool
$_httpMethodOverride  : bool
Use POST instead of PUT and DELETE, sending X-HTTP-Method-Override with the intended method name instead.
$_lastRequest  : Horde_Http_Request_Base
The previous HTTP request.
$_lastResponse  : Horde_Http_Response_Base
The most recent HTTP response.
$_request  : Horde_Http_Request_Base
The current HTTP request.
__construct()  : mixed
Horde_Http_Client constructor.
__get()  : mixed
Returns a client parameter.
__set()  : mixed
Sets a client parameter.
delete()  : Horde_Http_Response_Base
Sends a DELETE request.
get()  : Horde_Http_Response_Base
Sends a GET request.
head()  : Horde_Http_Response_Base
Sends a HEAD request.
post()  : Horde_Http_Response_Base
Sends a POST request.
put()  : Horde_Http_Response_Base
Sends a PUT request.
request()  : Horde_Http_Response_Base
Sends an HTTP request.

Properties

$httpMethodOverride

public bool $httpMethodOverride

@see $_httpMethodOverride

$request.authenticationScheme write-only

public string $request.authenticationScheme

Authentication method, one of the Horde_Http::AUTH_* constants.

$request.data write-only

public array<string|int, mixed>|string $request.data

POST data fields or POST/PUT data body.

$request.headers write-only

public array<string|int, mixed> $request.headers

Hash with additional request headers.

$request.method write-only

public string $request.method

Default request method if not specified for individual requests.

$request.password write-only

public string $request.password

Authentication password.

$request.proxyAuthenticationScheme write-only

public string $request.proxyAuthenticationScheme

Proxy authentication method, one of the Horde_Http::AUTH_* constants.

$request.proxyPassword write-only

public string $request.proxyPassword

Proxy authentication password.

$request.proxyPort write-only

public int $request.proxyPort

Port number of a proxy server.

$request.proxyServer write-only

public string $request.proxyServer

Host name of a proxy server.

$request.proxyType write-only

public int $request.proxyType

Proxy server type, one of the Horde_Http::PROXY_* constants.

$request.proxyUsername write-only

public string $request.proxyUsername

Proxy authentication user name.

$request.redirects write-only

public int $request.redirects

Maximum number of redirects to follow.

$request.timeout write-only

public int $request.timeout

Timeout in seconds.

$request.uri write-only

public string|Horde_Url $request.uri

Default URI if not specified for individual requests.

$request.username write-only

public string $request.username

Authentication user name.

$request.verifyPeer write-only

public bool $request.verifyPeer

Verify SSL peer certificates?

$_httpMethodOverride

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

protected bool $_httpMethodOverride = \false

Methods

__construct()

Horde_Http_Client constructor.

public __construct([array<string|int, mixed> $args = array() ]) : mixed
Parameters
$args : array<string|int, mixed> = array()

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

Return values
mixed

__get()

Returns a client parameter.

public __get(string $name) : mixed
Parameters
$name : string

The parameter to return.

Return values
mixed

The parameter value.

__set()

Sets a client parameter.

public __set(string $name, mixed $value) : mixed
Parameters
$name : string

The parameter to set.

$value : mixed

The parameter value.

Return values
mixed

post()

Sends a POST request.

public post([string $uri = null ][, array<string|int, mixed>|string $data = null ][, array<string|int, mixed> $headers = array() ]) : Horde_Http_Response_Base
Parameters
$uri : string = null

Request URI.

$data : array<string|int, mixed>|string = null

Data fields or data body.

$headers : array<string|int, mixed> = array()

Additional request headers.

Tags
throws
Horde_Http_Exception
Return values
Horde_Http_Response_Base

put()

Sends a PUT request.

public put([string $uri = null ][, string $data = null ][, array<string|int, mixed> $headers = array() ]) : Horde_Http_Response_Base
Parameters
$uri : string = null

Request URI.

$data : string = null

Data body.

$headers : array<string|int, mixed> = array()

Additional request headers.

Tags
throws
Horde_Http_Exception
Return values
Horde_Http_Response_Base

request()

Sends an HTTP request.

public request(string $method[, string|Horde_Url $uri = null ][, string|array<string|int, mixed> $data = null ][, array<string|int, mixed> $headers = array() ]) : Horde_Http_Response_Base
Parameters
$method : string

HTTP request method (GET, PUT, etc.)

$uri : string|Horde_Url = null

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

$data : string|array<string|int, mixed> = null

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

$headers : array<string|int, mixed> = array()

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

Tags
throws
Horde_Http_Exception
Return values
Horde_Http_Response_Base

Search results