Http
Extends HttpHTTP client class for connecting to a GitHub instance.
| since |
1.0 |
|---|---|
| deprecated |
2.0 Use Joomla\Http\Http instead |
| package |
Joomla Framework |
Methods
__construct
Constructor.
__construct(array|\ArrayAccess options = array(), \Joomla\Http\TransportInterface transport = null) : mixed
| since |
1.0 |
|---|---|
| throws |
|
Arguments
- options
array|\ArrayAccessClient options array. If the registry contains any headers.* elements, these will be added to the request headers.- transport
\Joomla\Http\TransportInterfaceThe HTTP transport object.
Response
mixed
delete
Method to send the DELETE command to the server.
delete(string|\Joomla\Uri\UriInterface url, array headers = array(), int timeout = null, mixed data = null) : \Joomla\Http\Response
| since |
1.0 |
|---|
Arguments
- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.- data
mixedEither an associative array or a string to be sent with the request.
Response
\Joomla\Http\Response
get
Method to send the GET command to the server.
get(string|\Joomla\Uri\UriInterface url, array headers = array(), int timeout = null) : \Joomla\Http\Response
| since |
1.0 |
|---|
Arguments
- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.
Response
\Joomla\Http\Response
getOption
Get an option from the HTTP client.
getOption(string key) : mixed
| since |
1.0 |
|---|
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|\Joomla\Uri\UriInterface url, array headers = array(), int timeout = null) : \Joomla\Http\Response
| since |
1.0 |
|---|
Arguments
- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.
Response
\Joomla\Http\Response
makeTransportRequest
Send a request to the server and return a Response object with the response.
makeTransportRequest(string method, string|\Joomla\Uri\UriInterface url, mixed data = null, array headers = array(), int timeout = null) : \Joomla\Http\Response
| since |
1.0 |
|---|---|
| throws |
|
Arguments
- method
stringThe HTTP method for sending the request.- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- data
mixedEither an associative array or a string to be sent with the request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.
Response
\Joomla\Http\Response
options
Method to send the OPTIONS command to the server.
options(string|\Joomla\Uri\UriInterface url, array headers = array(), int timeout = null) : \Joomla\Http\Response
| since |
1.0 |
|---|
Arguments
- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.
Response
\Joomla\Http\Response
patch
Method to send the PATCH command to the server.
patch(string|\Joomla\Uri\UriInterface url, mixed data, array headers = array(), int timeout = null) : \Joomla\Http\Response
| since |
1.0 |
|---|
Arguments
- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- data
mixedEither an associative array or a string to be sent with the request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.
Response
\Joomla\Http\Response
post
Method to send the POST command to the server.
post(string|\Joomla\Uri\UriInterface url, mixed data, array headers = array(), int timeout = null) : \Joomla\Http\Response
| since |
1.0 |
|---|
Arguments
- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- data
mixedEither an associative array or a string to be sent with the request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.
Response
\Joomla\Http\Response
put
Method to send the PUT command to the server.
put(string|\Joomla\Uri\UriInterface url, mixed data, array headers = array(), int timeout = null) : \Joomla\Http\Response
| since |
1.0 |
|---|
Arguments
- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- data
mixedEither an associative array or a string to be sent with the request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.
Response
\Joomla\Http\Response
setOption
Set an option for the HTTP client.
setOption(string key, mixed value) : \Joomla\Http\Http
| since |
1.0 |
|---|
Arguments
- key
stringThe name of the option to set.- value
mixedThe option value to set.
Response
\Joomla\Http\HttpThis object for method chaining.
trace
Method to send the TRACE command to the server.
trace(string|\Joomla\Uri\UriInterface url, array headers = array(), int timeout = null) : \Joomla\Http\Response
| since |
1.0 |
|---|
Arguments
- url
string|\Joomla\Uri\UriInterfaceThe URI to the resource to request.- headers
arrayAn array of request headers to send with the request.- timeout
intRead timeout in seconds.
Response
\Joomla\Http\Response
Constants
AUTHENTICATION_NONE
| Value | 0 |
|---|---|
| const |
integer Use no authentication for HTTP connections. |
| since |
1.0 |
| deprecated |
2.0 |
AUTHENTICATION_BASIC
| Value | 1 |
|---|---|
| const |
integer Use basic authentication for HTTP connections. |
| since |
1.0 |
| deprecated |
2.0 |
AUTHENTICATION_OAUTH
| Value | 2 |
|---|---|
| const |
integer Use OAuth authentication for HTTP connections. |
| since |
1.0 |
| deprecated |
2.0 |
Properties
options
Options for the HTTP client.
| since |
1.0 |
|---|
Type(s)
array|\ArrayAccess
transport
The HTTP transport object to use in sending HTTP requests.
| since |
1.0 |
|---|
Type(s)
\Joomla\Http\TransportInterface