WordPress at a glance
function is not described

WP_REST_Request::__construct() public WP 4.4.0

Constructor.

{} It's a method of the class: WP_REST_Request{}

No Hooks.

Return

Null. Nothing.

Usage

$WP_REST_Request = new WP_REST_Request();
$WP_REST_Request->__construct( $method, $route, $attributes );
$method(string)
Request method.
Default: ''
$route(string)
Request route.
Default: ''
$attributes(array)
Request attributes.
Default: empty array

Changelog

Since 4.4.0 Introduced.

Code of WP_REST_Request::__construct() WP 5.5.3

<?php
public function __construct( $method = '', $route = '', $attributes = array() ) {
	$this->params = array(
		'URL'      => array(),
		'GET'      => array(),
		'POST'     => array(),
		'FILES'    => array(),

		// See parse_json_params.
		'JSON'     => null,

		'defaults' => array(),
	);

	$this->set_method( $method );
	$this->set_route( $route );
	$this->set_attributes( $attributes );
}