[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> class-wp-http-requests-response.php (summary)

HTTP API: WP_HTTP_Requests_Response class

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

Defines 1 class

WP_HTTP_Requests_Response:: (11 methods):
  __construct()
  get_response_object()
  get_headers()
  set_headers()
  header()
  get_status()
  set_status()
  get_data()
  set_data()
  get_cookies()
  to_array()


Class: WP_HTTP_Requests_Response  - X-Ref

Core wrapper object for a Requests_Response for standardisation.

__construct( Requests_Response $response, $filename = '' )   X-Ref
Constructor.

since: 4.6.0
param: Requests_Response $response HTTP response.
param: string            $filename Optional. File name. Default empty.

get_response_object()   X-Ref
Retrieves the response object for the request.

return: Requests_Response HTTP response.
since: 4.6.0

get_headers()   X-Ref
Retrieves headers associated with the response.

return: \Requests_Utility_CaseInsensitiveDictionary Map of header name to header value.
since: 4.6.0

set_headers( $headers )   X-Ref
Sets all header values.

since: 4.6.0
param: array $headers Map of header name to header value.

header( $key, $value, $replace = true )   X-Ref
Sets a single HTTP header.

since: 4.6.0
param: string $key     Header name.
param: string $value   Header value.
param: bool   $replace Optional. Whether to replace an existing header of the same name.

get_status()   X-Ref
Retrieves the HTTP return code for the response.

return: int The 3-digit HTTP status code.
since: 4.6.0

set_status( $code )   X-Ref
Sets the 3-digit HTTP status code.

since: 4.6.0
param: int $code HTTP status.

get_data()   X-Ref
Retrieves the response data.

return: string Response data.
since: 4.6.0

set_data( $data )   X-Ref
Sets the response data.

since: 4.6.0
param: string $data Response data.

get_cookies()   X-Ref
Retrieves cookies from the response.

return: WP_HTTP_Cookie[] List of cookie objects.
since: 4.6.0

to_array()   X-Ref
Converts the object to a WP_Http response array.

return: array WP_Http response array, per WP_Http::request().
since: 4.6.0



Generated: Tue Dec 24 01:00:02 2024 Cross-referenced by PHPXref 0.7.1