JHttpTransportStream
Implements \JHttpTransportHTTP transport class for using PHP streams.
package |
Joomla.Platform |
---|---|
subpackage |
HTTP |
since |
11.3 |
Methods
__construct
Constructor.
__construct(\JRegistry &$options)
getResponse
Method to get a response object from a server response.
getResponse(array $headers, string $body) : \JHttpResponse
since |
11.3 |
---|---|
throws |
|
Arguments
- $headers
array
The response headers as an array.- $body
string
The response body as a string.
Response
isSupported
method to check if http transport stream available for using
isSupported() : boolean
static
since |
12.1 |
---|
Response
boolean
true if available else false
request
Send a request to the server and return a JHttpResponse object with the response.
request(string $method, \JUri $uri, mixed $data = null, array $headers = null, integer $timeout = null, string $userAgent = null) : \JHttpResponse
since |
11.3 |
---|
Arguments
- $method
string
The HTTP method for sending the request.- $uri
\JUri
The URI to the resource to request.- $data
mixed
Either an associative array or a string to be sent with the request.- $headers
array
An array of request headers to send with the request.- $timeout
integer
Read timeout in seconds.- $userAgent
string
The optional user agent string to send with the request.