钩子文档

http_api_debug

💡 云策文档标注

概述

http_api_debug 是一个 WordPress 钩子,在 HTTP API 响应接收后、返回前触发,用于调试 HTTP 请求和响应。

关键要点

  • 触发时机:HTTP API 响应接收后、返回前
  • 参数:$response(响应数组或 WP_Error 对象)、$context(上下文字符串)、$class(HTTP 传输类名)、$parsed_args(HTTP 请求参数数组)、$url(请求 URL)
  • 相关函数:WP_Http::_dispatch_request() 和 WP_Http::request()
  • 引入版本:WordPress 2.8.0

📄 原文内容

Fires after an HTTP API response is received and before the response is returned.

Parameters

$responsearray|WP_Error
HTTP response or WP_Error object.
$contextstring
Context under which the hook is fired.
$classstring
HTTP transport used.
$parsed_argsarray
HTTP request arguments.
$urlstring
The request URL.

Source

do_action( 'http_api_debug', $response, 'response', 'WpOrgRequestsRequests', $parsed_args, $url );

Changelog

Version Description
2.8.0 Introduced.