JHttp
HTTP client class.
package |
Joomla.Platform |
---|---|
subpackage |
HTTP |
since |
11.3 |
Methods
__construct
Constructor.
__construct(\JRegistry &$options = null, \JHttpTransport $transport = null)
delete
Method to send the DELETE command to the server.
delete(string $url, array $headers = null) : \JHttpResponse
since |
11.3 |
---|
Arguments
- $url
string
Path to the resource.- $headers
array
An array of name-value pairs to include in the header of the request.
Response
get
Method to send the GET command to the server.
get(string $url, array $headers = null) : \JHttpResponse
since |
11.3 |
---|
Arguments
- $url
string
Path to the resource.- $headers
array
An array of name-value pairs to include in the header of the request.
Response
getOption
Get an option from the HTTP client.
getOption(string $key) : mixed
since |
11.3 |
---|
Arguments
- $key
string
The name of the option to get.
Response
mixed
The option value.
head
Method to send the HEAD command to the server.
head(string $url, array $headers = null) : \JHttpResponse
since |
11.3 |
---|
Arguments
- $url
string
Path to the resource.- $headers
array
An array of name-value pairs to include in the header of the request.
Response
options
Method to send the OPTIONS command to the server.
options(string $url, array $headers = null) : \JHttpResponse
since |
11.3 |
---|
Arguments
- $url
string
Path to the resource.- $headers
array
An array of name-value pairs to include in the header of the request.
Response
post
Method to send the POST command to the server.
post(string $url, mixed $data, array $headers = null) : \JHttpResponse
since |
11.3 |
---|
Arguments
- $url
string
Path to the resource.- $data
mixed
Either an associative array or a string to be sent with the request.- $headers
array
An array of name-value pairs to include in the header of the request.
Response
put
Method to send the PUT command to the server.
put(string $url, mixed $data, array $headers = null) : \JHttpResponse
since |
11.3 |
---|
Arguments
- $url
string
Path to the resource.- $data
mixed
Either an associative array or a string to be sent with the request.- $headers
array
An array of name-value pairs to include in the header of the request.
Response
setOption
Set an option for the HTTP client.
setOption(string $key, mixed $value) : \JHttp
since |
11.3 |
---|
Arguments
- $key
string
The name of the option to set.- $value
mixed
The option value to set.
Response
\JHttp
This 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
string
Path to the resource.- $headers
array
An array of name-value pairs to include in the header of the request.
Response
Properties
transport
The HTTP transport object to use in sending HTTP requests.