[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/Requests/src/ -> Response.php (summary)

HTTP response class Contains a response from \WpOrg\Requests\Requests::request()

File Size: 165 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Response:: (4 methods):
  __construct()
  is_redirect()
  throw_for_status()
  decode_body()


Class: Response  - X-Ref

HTTP response class

Contains a response from \WpOrg\Requests\Requests::request()

__construct()   X-Ref
Constructor


is_redirect()   X-Ref
Is the response a redirect?

return: boolean True if redirect (3xx status), false if not.

throw_for_status($allow_redirects = true)   X-Ref
Throws an exception if the request was not successful

param: boolean $allow_redirects Set to false to throw on a 3xx as well

decode_body($associative = true, $depth = 512, $options = 0)   X-Ref
JSON decode the response body.

The method parameters are the same as those for the PHP native `json_decode()` function.

return: array
param: bool|null $associative Optional. When `true`, JSON objects will be returned as associative arrays;
param: int       $depth       Optional. Maximum nesting depth of the structure being decoded.
param: int       $options     Optional. Bitmask of JSON_BIGINT_AS_STRING, JSON_INVALID_UTF8_IGNORE,



Generated : Sat Apr 27 08:20:02 2024 Cross-referenced by PHPXref