WordPress at a glance
function is not described

rest_url() WP 4.4.0

Retrieves the URL to a REST endpoint.

Note: The returned URL is NOT escaped.

No Hooks.


String. Full URL to the endpoint.


rest_url( $path, $scheme );
REST route.
Default: ''
Sanitization scheme.
Default: 'json'

Code of rest url: wp-includes/rest-api.php WP 5.2.2

function rest_url( $path = '', $scheme = 'json' ) {
	return get_rest_url( null, $path, $scheme );