CurlTransport
Implements \Joomla\CMS\Http\TransportInterfaceHTTP transport class for using cURL.
since |
1.7.3 |
---|
Methods
__construct
Constructor. CURLOPT_FOLLOWLOCATION must be disabled when open_basedir or safe_mode are enabled.
__construct(\Joomla\Registry\Registry $options)
link | |
---|---|
since |
1.7.3 |
throws |
|
Arguments
- $options
\Joomla\Registry\Registry
Client options object.
getResponse
Method to get a response object from a server response.
getResponse(string $content, array $info) : \Joomla\CMS\Http\Response
since |
1.7.3 |
---|---|
throws |
|
Arguments
- $content
string
The complete server response, including headers as a string if the response has no errors.- $info
array
The cURL request information.
Response
isSupported
Method to check if HTTP transport cURL is available for use
isSupported() : boolean
since |
3.0.0 |
---|
Response
boolean
true if available, else false
redirectsAllowed
Check if redirects are allowed
redirectsAllowed() : boolean
since |
3.0.0 |
---|
Response
boolean
request
Send a request to the server and return a HttpResponse object with the response.
request(string $method, \Joomla\CMS\Uri\Uri $uri, mixed $data = null, array $headers = null, integer $timeout = null, string $userAgent = null) : \Joomla\CMS\Http\Response
since |
1.7.3 |
---|---|
throws |
|
Arguments
- $method
string
The HTTP method for sending the request.- $uri
\Joomla\CMS\Uri\Uri
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.