HTTP request method uses Streams to retrieve the url.

Requires PHP 5.0+ and uses fopen with stream context. Requires that 'allow_url_fopen' PHP setting to be enabled.

Second preferred method for getting the URL, for PHP 5.

package WordPress
subpackage HTTP
since 2.7.0

 Methods

Send a HTTP request to a URI using streams with fopen().

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
access public
since 2.7.0

Parameters

$args

Returns

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