HTTP request method uses Curl extension to retrieve the url.

Requires the Curl extension to be installed.

package WordPress
subpackage HTTP
since 2.7

 Methods

Send a HTTP request to a URI using cURL extension.

request(string $url, \str|array $args = array()) : array
access public
since 2.7.0

Parameters

$url

string

$args

\strarray

Optional. Override the defaults.

Returns

array'headers', 'body', 'cookies' and 'response' keys.

Whether this class can be used for retrieving an URL.

test($args = array()) : boolean
Static
static
since 2.7.0

Parameters

$args

Returns

booleanFalse means this class can not be used, true means it can.