It is evaluated in the private
WP_Http::_dispatch_request() method, which is called by
WP_Http::request() in wp-includes/class-http.php file.
http_response filter accepts three arguments:
$responseThe response array
$argsAn array of arguments (see
$urlThe URL to request
Let’s say you’re pinging some external site and displaying the body of the requested site somewhere but you only want to display the content if it is actually valid — say, based on whether the status code is 200, 301, or 302. For any other status code, you want to override the body of the http response with some general template.
View the code example on GistHave a suggested improvement? You can fork the Gist and comment back with the link. If all is agreeable, I’ll merge in your changes. Crowd-sourced documentation FTW!