W3cubDocs

/WordPress

WP_HTTP_Response::__construct( mixed $data = null, int $status = 200, array $headers = array() )

Constructor.

Parameters

$data

(mixed) (Optional) Response data.

Default value: null

$status

(int) (Optional) HTTP status code.

Default value: 200

$headers

(array) (Optional) HTTP header map.

Default value: array()

Source

File: wp-includes/class-wp-http-response.php

public function __construct( $data = null, $status = 200, $headers = array() ) {
		$this->set_data( $data );
		$this->set_status( $status );
		$this->set_headers( $headers );
	}

Changelog

Version Description
4.4.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_http_response/__construct