HTTP request method uses fopen function to retrieve the url.
Requires PHP version greater than 4.3.0 for stream support. Does not allow for $context support, but should still be okay, to write the headers, before getting the response. Also requires that 'allow_url_fopen' to be enabled.
package | WordPress |
---|---|
subpackage | HTTP |
since | 2.7.0 |
request(string $url, \str|array $args = array()
) : array
This transport does not support sending of headers and body, therefore should not be used in the instances, where there is a body and headers.
Notes: Does not support non-blocking mode. Ignores 'redirection' option.
see | For default options descriptions. |
---|---|
access | public |
since | 2.7.0 |
string
URI resource.
\str
array
Optional. Override the defaults.
array
'headers', 'body', 'cookies' and 'response' keys.test($args = array()
) : boolean
since | 2.7.0 |
---|---|
static |
boolean
False means this class can not be used, true means it can.