wp-includes/Requests/src/Response.php:122Throws an exception if the request was not successful
$allow_redirectsbooleanoptionaltrue public function throw_for_status($allow_redirects = true) { if ($this->is_redirect()) { if ($allow_redirects !== true) { throw new Exception('Redirection not allowed', 'response.no_redirects', $this); } } elseif (!$this->success) { $exception = Http::get_class($this->status_code); throw new $exception(null, $this); } }Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/Requests/src/Response.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.