CurlTransport

Extends \Joomla\Http\AbstractTransport Implements TransportInterface

HTTP transport class for using cURL.

since

1.7.3

package

Application

Methods

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

\Joomla\Http\Exception\InvalidResponseCodeException

Arguments

content

stringThe complete server response, including headers as a string if the response has no errors.

info

arrayThe cURL request information.

Response

\Joomla\CMS\Http\Response

isSupported

Method to check if HTTP transport cURL is available for use

isSupported() : bool
static
since

3.0.0

Response

booltrue if available, else false

redirectsAllowed

Check if redirects are allowed

redirectsAllowed() : bool
since

3.0.0

Response

bool

request

Send a request to the server and return a Response object with the response.

request(string method, \Joomla\Uri\UriInterface uri, mixed data = null, array headers = [], int timeout = null, string userAgent = null) : \Joomla\CMS\Http\Response
since

1.7.3

throws

\RuntimeException

Arguments

method

stringThe HTTP method for sending the request.

uri

\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.

userAgent

stringThe optional user agent string to send with the request.

Response

\Joomla\CMS\Http\Response