JHttp

HTTP client class.

package

Joomla.Platform

subpackage

HTTP

since

11.3

Methods

__construct

Constructor.

__construct(\JRegistry &$options = null, \JHttpTransport $transport = null) 
since

11.3

Arguments

$options

\JRegistry

$transport

\JHttpTransportThe HTTP transport object.

delete

Method to send the DELETE command to the server.

delete(string $url, array $headers = null) : \JHttpResponse
since

11.3

Arguments

$url

stringPath to the resource.

$headers

arrayAn array of name-value pairs to include in the header of the request.

Response

\JHttpResponse

get

Method to send the GET command to the server.

get(string $url, array $headers = null) : \JHttpResponse
since

11.3

Arguments

$url

stringPath to the resource.

$headers

arrayAn array of name-value pairs to include in the header of the request.

Response

\JHttpResponse

getOption

Get an option from the HTTP client.

getOption(string $key) : mixed
since

11.3

Arguments

$key

stringThe name of the option to get.

Response

mixedThe option value.

head

Method to send the HEAD command to the server.

head(string $url, array $headers = null) : \JHttpResponse
since

11.3

Arguments

$url

stringPath to the resource.

$headers

arrayAn array of name-value pairs to include in the header of the request.

Response

\JHttpResponse

options

Method to send the OPTIONS command to the server.

options(string $url, array $headers = null) : \JHttpResponse
since

11.3

Arguments

$url

stringPath to the resource.

$headers

arrayAn array of name-value pairs to include in the header of the request.

Response

\JHttpResponse

post

Method to send the POST command to the server.

post(string $url, mixed $data, array $headers = null) : \JHttpResponse
since

11.3

Arguments

$url

stringPath to the resource.

$data

mixedEither an associative array or a string to be sent with the request.

$headers

arrayAn array of name-value pairs to include in the header of the request.

Response

\JHttpResponse

put

Method to send the PUT command to the server.

put(string $url, mixed $data, array $headers = null) : \JHttpResponse
since

11.3

Arguments

$url

stringPath to the resource.

$data

mixedEither an associative array or a string to be sent with the request.

$headers

arrayAn array of name-value pairs to include in the header of the request.

Response

\JHttpResponse

setOption

Set an option for the HTTP client.

setOption(string $key, mixed $value) : \JHttp
since

11.3

Arguments

$key

stringThe name of the option to set.

$value

mixedThe option value to set.

Response

\JHttpThis object for method chaining.

trace

Method to send the TRACE command to the server.

trace(string $url, array $headers = null) : \JHttpResponse
since

11.3

Arguments

$url

stringPath to the resource.

$headers

arrayAn array of name-value pairs to include in the header of the request.

Response

\JHttpResponse

Properties

options

Options for the HTTP client.

since

11.3

Type(s)

\JRegistry

transport

The HTTP transport object to use in sending HTTP requests.

since

11.3

Type(s)

\JHttpTransport