wp-includes/Requests/src/Response.php:24HTTP response class
$bodystringpublic$rawstringpublic$headersWpOrg\Requests\Response\Headerspublic$status_codeinteger|booleanpublic$protocol_versionfloat|booleanpublic$successbooleanpublic$redirectsintegerpublic$urlstringpublic$historyarraypublic$cookiesWpOrg\Requests\Cookie\Jarpublicclass Response { /** * Response body * * @var string */ public $body = ''; /** * Raw HTTP data from the transport * * @var string */ public $raw = ''; /** * Headers, as an associative array * * @var \WpOrg\Requests\Response\Headers Array-like object representing headers */ public $headers = []; /** * Status code, false if non-blocking * * @var integer|boolean */ public $status_code = false; /** * Protocol version, false if non-blocking * * @var float|boolean */ public $protocol_version = false; /** * Whether the request succeeded or not * * @var boolean */ public $success = false; /** * Number of redirects the request used * * @var integer */ public $redirects = 0; /** * URL requested * * @var string */ public $url = ''; /** * Previous requests (from redirects) * * @var array Array of \WpOrg\Requests\Response objects */ public $history = []; /** * Cookies from the request * * @var \WpOrg\Requests\Cookie\Jar Array-like object representing a cookie jar */ public $cookies = []; /** * Constructor */ public function __construct() { $this->headers = new Headers(); $this->cookies = new Jar(); }6 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
getStatusCode() added.verified against sourcegetReasonPhrase() added.verified against sourcewithStatus() added.verified against sourceis_redirect() removed.verified against sourcethrow_for_status() removed.verified against sourcedecode_body() removed.verified against sourcesrc/wp-includes/Requests/src/Response.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.