Performs an HTTP request and returns its response.
Description
There are other API functions available which abstract away the HTTP method: <ul> <li>Default 'GET' for wp_remote_get()</li> <li>Default 'POST' for wp_remote_post()</li> <li>Default 'HEAD' for wp_remote_head()</li> </ul> Important: If the URL is user-controlled, use wp_safe_remote_request() instead.
Parameters
$urlstring
URL to retrieve.
$argsarrayoptional
Request arguments. Default empty array. See WP_Http::request() for information on accepted arguments.Default: array()
Return
array|WP_Error
The response array or a WP_Error on failure. See WP_Http::request() for information on return value.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/http.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.