Curl

Extends AbstractTransport

HTTP transport class for using cURL.

since

1.0

package

Joomla Framework

Methods

__construct

Constructor.

__construct(array|\ArrayAccess options = []) : 
inherited
since

2.0.0

throws

RuntimeException

Arguments

options

array<string|int, mixed>|ArrayAccessClient options array.

Response

mixed

getOption

Get an option from the HTTP transport.

getOption( key,  default = null) : 
inherited
since

2.0.0

Arguments

key

stringThe name of the option to get.

default

mixedThe default value if the option is not set.

Response

mixedThe option value.

getResponse

Method to get a response object from a server response.

getResponse( content, mixed||string|int info) : \Joomla\Http\Response
since

1.0

throws

InvalidResponseCodeException

Arguments

content

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

info

array<string|int, mixed>The cURL request information.

Response

Response

isSupported

Method to check if HTTP transport cURL is available for use

isSupported() : 
static
since

1.0

Response

boolTrue if available, else false

mapProtocolVersion

Get the cURL constant for a HTTP protocol version

mapProtocolVersion( version) : 
since

1.3.1

Arguments

version

stringThe HTTP protocol version to use

Response

int

processHeaders

Processes the headers from a transport's response data.

processHeaders(mixed||string|int headers) : mixed||string|int
inherited
since

2.0.0

Arguments

headers

array<string|int, mixed>The headers to process.

Response

array<string|int, mixed>

redirectsAllowed

Check if redirects are allowed

redirectsAllowed() : 
since

1.2.1

Response

bool

request

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

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

1.0

throws

RuntimeException

Arguments

method

stringThe HTTP method for sending the request.

uri

UriInterfaceThe URI to the resource to request.

data

mixedEither an associative array or a string to be sent with the request.

headers

array<string|int, mixed>An 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

Response

setCAOptionAndValue

Configure the cURL resources with the appropriate root certificates.

setCAOptionAndValue(\CurlHandle ch) : 
since

1.3.2

Arguments

ch

CurlHandleThe cURL resource you want to configure the certificates on.

Response

void

Properties

options

The client options.

inherited
since

2.0.0

Type(s)

array<string|int, mixed>|ArrayAccess