WordPress at a glance
function is not described

rest_do_request() WP 4.4.0

Do a REST request.

Used primarily to route internal requests through WP_REST_Server.

No Hooks.

Return

WP_REST_Response. REST response.

Usage

rest_do_request( $request );
$request(WP_REST_Request|string) (required)
Request.

Changelog

Since 4.4.0 Introduced.

Code of rest_do_request() WP 5.7.2

<?php
function rest_do_request( $request ) {
	$request = rest_ensure_request( $request );
	return rest_get_server()->dispatch( $request );
}