This method initiates a request and sends it via a transport before
parsing.

The $options parameter takes an associative array with the following
options:

timeout: How long should we wait for a response? Note: for cURL, a minimum of 1 second applies, as DNS resolution operates at second-resolution only. (float, seconds with a millisecond precision, default: 10, example: 0.01)

connect_timeout: How long should we wait while trying to connect? (float, seconds with a millisecond precision, default: 10, example: 0.01)

useragent: Useragent to send to the server (string, default: php-requests/$version)

verify: Should we verify SSL certificates? Allows passing in a custom certificate file as a string. (Using true uses the system-wide root certificate store instead, but this may have different behaviour across transports.) (string|boolean, default: library/Requests/Transport/cacert.pem)

verifyname: Should we verify the common name in the SSL certificate? (boolean: default, true)

data_format: How should we send the $data parameter? (string, one of 'query' or 'body', default: 'query' for HEAD/GET/DELETE, 'body' for POST/PUT/OPTIONS/PATCH)

Parameters

$url

URL to request

$headers

Extra headers to send with the request

$data

Data to send either as a query string for GET/HEAD requests, or in the body for POST requests

The $requests parameter takes an associative or indexed array of
request fields. The key of each request can be used to match up the
request with the returned data, or with the request passed into your
multiple.request.complete callback.

The request fields value is an associative array with the following keys:

cookies: Associative array of cookie name to value, or cookie jar. (array|Requests_Cookie_Jar)

If the $options parameter is specified, individual requests will
inherit options from it. This can be used to use a single hooking system,
or set all the types to Requests::POST, for example.

In addition, the $options parameter takes the following global options:

complete: A callback for when a request is complete. Takes two parameters, a Requests_Response/Requests_Exception reference, and the ID from the request array (Note: this can also be overridden on a per-request basis, although that's a little silly) (callback)

Parameters

Returns

Decompression of deflated string while staying compatible with the majority of servers.

Decompression of deflated string while staying compatible with the majority of servers.

Certain Servers will return deflated data with headers which PHP's gzinflate()
function cannot handle out of the box. The following function has been created from
various snippets on the gzinflate() PHP documentation.

Warning: Magic numbers within. Due to the potential different formats that the compressed
data may be returned in, some "magic offsets" are needed to ensure proper decompression
takes place. For a simple progmatic way to determine the magic offset in use, see:
https://core.trac.wordpress.org/ticket/18273