Base HTTP transport

package Requests
subpackage Transport

 Methods

Perform a request

request(string $url, array $headers = array(), string|array $data = array(), array $options = array()) : string

Parameters

$url

string

URL to request

$headers

array

Associative array of request headers

$data

stringarray

Data to send either as the POST body, or as parameters in the URL for a GET/HEAD

$options

array

Request options, see {@see Requests::response()} for documentation

Returns

stringRaw HTTP result

Send multiple requests simultaneously

request_multiple(array $requests, array $options) : array

Parameters

$requests

array

Request data (array of 'url', 'headers', 'data', 'options') as per {@see Requests_Transport::request}

$options

array

Global options, see {@see Requests::response()} for documentation

Returns

arrayArray of Requests_Response objects (may contain Requests_Exception or string responses as well)

Self-test whether the transport can be used

test() : boolean
Static

Returns

boolean