Title: wp-includes/rest-api/class-wp-rest-server.php | Developer.WordPress.org

---

# File: wp-includes/rest-api/class-wp-rest-server.php

 * method[WP_REST_Server::get_target_hints_for_link()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_target_hints_for_link/)
 * Gets the target hints for a REST API Link.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_target_hints_for_link/#used-by)
   | Uses [5 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/get_target_hints_for_link/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:666](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L666-L706)
 * method[WP_REST_Server::is_dispatching()](https://developer.wordpress.org/reference/classes/wp_rest_server/is_dispatching/)
 * Returns whether the REST server is currently dispatching / responding to a request.
 * Used by [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/is_dispatching/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/is_dispatching/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1140](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1140-L1142)
 * method[WP_REST_Server::get_json_encode_options()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_json_encode_options/)
 * Gets the encoding options passed to {@see wp_json_encode}.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_json_encode_options/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_json_encode_options/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:251](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L251-L267)
 * hook[rest_json_encode_options](https://developer.wordpress.org/reference/hooks/rest_json_encode_options/)
 * Filters the JSON encoding options used to send the REST API response.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_json_encode_options/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_json_encode_options/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:266](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L266-L266)
 * method[WP_REST_Server::add_site_icon_to_index()](https://developer.wordpress.org/reference/classes/wp_rest_server/add_site_icon_to_index/)
 * Exposes the site icon through the WordPress REST API.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/add_site_icon_to_index/#used-by)
   | Uses [3 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/add_site_icon_to_index/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1500](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1500-L1506)
 * method[WP_REST_Server::add_image_to_index()](https://developer.wordpress.org/reference/classes/wp_rest_server/add_image_to_index/)
 * Exposes an image through the WordPress REST API.
 * Used by [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/add_image_to_index/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/add_image_to_index/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1519](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1519-L1531)
 * method[WP_REST_Server::add_site_logo_to_index()](https://developer.wordpress.org/reference/classes/wp_rest_server/add_site_logo_to_index/)
 * Exposes the site logo through the WordPress REST API.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/add_site_logo_to_index/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/add_site_logo_to_index/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1484](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1484-L1488)
 * method[WP_REST_Server::add_active_theme_link_to_index()](https://developer.wordpress.org/reference/classes/wp_rest_server/add_active_theme_link_to_index/)
 * Adds a link to the active theme for users who have proper permissions.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/add_active_theme_link_to_index/#used-by)
   | Uses [4 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/add_active_theme_link_to_index/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1452](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1452-L1472)
 * method[WP_REST_Server::get_max_batch_size()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_max_batch_size/)
 * Gets the maximum number of requests that can be included in a batch.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_max_batch_size/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_max_batch_size/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1722](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1722-L1731)
 * hook[rest_get_max_batch_size](https://developer.wordpress.org/reference/hooks/rest_get_max_batch_size/)
 * Filters the maximum number of REST API requests that can be included in a batch.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_get_max_batch_size/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_get_max_batch_size/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1730](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1730-L1730)
 * method[WP_REST_Server::serve_batch_request_v1()](https://developer.wordpress.org/reference/classes/wp_rest_server/serve_batch_request_v1/)
 * Serves the batch/v1 request.
 * Used by [0 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/serve_batch_request_v1/#used-by)
   | Uses [13 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/serve_batch_request_v1/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1741](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1741-L1900)
 * method[WP_REST_Server::match_request_to_handler()](https://developer.wordpress.org/reference/classes/wp_rest_server/match_request_to_handler/)
 * Matches a request object to its handler.
 * Used by [3 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/match_request_to_handler/#used-by)
   | Uses [5 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/match_request_to_handler/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1153](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1153-L1224)
 * method[WP_REST_Server::respond_to_request()](https://developer.wordpress.org/reference/classes/wp_rest_server/respond_to_request/)
 * Dispatches the request to the callback handler.
 * Used by [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/respond_to_request/#used-by)
   | Uses [7 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/respond_to_request/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1238](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1238-L1330)
 * hook[rest_exposed_cors_headers](https://developer.wordpress.org/reference/hooks/rest_exposed_cors_headers/)
 * Filters the list of response headers that are exposed to REST API CORS requests.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_exposed_cors_headers/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_exposed_cors_headers/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:408](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L408-L408)
 * hook[rest_allowed_cors_headers](https://developer.wordpress.org/reference/hooks/rest_allowed_cors_headers/)
 * Filters the list of request headers that are allowed for REST API CORS requests.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_allowed_cors_headers/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_allowed_cors_headers/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:434](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L434-L434)
 * hook[rest_pre_echo_response](https://developer.wordpress.org/reference/hooks/rest_pre_echo_response/)
 * Filters the REST API response.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_pre_echo_response/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_pre_echo_response/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:539](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L539-L539)
 * method[WP_REST_Server::remove_header()](https://developer.wordpress.org/reference/classes/wp_rest_server/remove_header/)
 * Removes an HTTP header from the current response.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/remove_header/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/remove_header/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1953](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1953-L1955)
 * hook[rest_request_after_callbacks](https://developer.wordpress.org/reference/hooks/rest_request_after_callbacks/)
 * Filters the response immediately after executing any REST API callbacks.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_request_after_callbacks/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_request_after_callbacks/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1318](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1318-L1318)
 * hook[rest_request_before_callbacks](https://developer.wordpress.org/reference/hooks/rest_request_before_callbacks/)
 * Filters the response before executing any REST API callbacks.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_request_before_callbacks/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_request_before_callbacks/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1256](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1256-L1256)
 * method[WP_REST_Server::get_compact_response_links()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_compact_response_links/)
 * Retrieves the CURIEs (compact URIs) used for relations.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_compact_response_links/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_compact_response_links/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:719](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L719-L757)
 * method[WP_REST_Server::get_headers()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_headers/)
 * Extracts headers from a PHP-style $_SERVER array.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_headers/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/get_headers/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1987](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1987-L2012)
 * method[WP_REST_Server::send_header()](https://developer.wordpress.org/reference/classes/wp_rest_server/send_header/)
 * Sends an HTTP header.
 * Used by [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/send_header/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/send_header/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1921](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1921-L1931)
 * method[WP_REST_Server::send_headers()](https://developer.wordpress.org/reference/classes/wp_rest_server/send_headers/)
 * Sends multiple HTTP headers.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/send_headers/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/send_headers/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1940](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1940-L1944)
 * method[WP_REST_Server::get_raw_data()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_raw_data/)
 * Retrieves the raw request entity (body).
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_raw_data/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/get_raw_data/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1966](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1966-L1977)
 * method[WP_REST_Server::get_data_for_routes()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_data_for_routes/)
 * Retrieves the publicly-visible data for routes.
 * Used by [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/get_data_for_routes/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/get_data_for_routes/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1588](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1588-L1621)
 * hook[rest_endpoints_description](https://developer.wordpress.org/reference/hooks/rest_endpoints_description/)
 * Filters the publicly-visible data for a single REST API route.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_endpoints_description/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_endpoints_description/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1605](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1605-L1605)
 * hook[rest_route_data](https://developer.wordpress.org/reference/hooks/rest_route_data/)
 * Filters the publicly-visible data for REST API routes.
 * Used by [1 function](https://developer.wordpress.org/reference/hooks/rest_route_data/#used-by)
   | Uses [0 functions](https://developer.wordpress.org/reference/hooks/rest_route_data/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1620](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1620-L1620)
 * method[WP_REST_Server::get_data_for_route()](https://developer.wordpress.org/reference/classes/wp_rest_server/get_data_for_route/)
 * Retrieves publicly-visible data for the route.
 * Used by [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/get_data_for_route/#used-by)
   | Uses [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/get_data_for_route/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1633](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1633-L1713)
 * method[WP_REST_Server::set_status()](https://developer.wordpress.org/reference/classes/wp_rest_server/set_status/)
 * Sends an HTTP status code.
 * Used by [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/set_status/#used-by)
   | Uses [1 function](https://developer.wordpress.org/reference/classes/wp_rest_server/set_status/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1909](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1909-L1911)
 * method[WP_REST_Server::dispatch()](https://developer.wordpress.org/reference/classes/wp_rest_server/dispatch/)
 * Matches the request to a callback and call it.
 * Used by [2 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/dispatch/#used-by)
   | Uses [8 functions](https://developer.wordpress.org/reference/classes/wp_rest_server/dispatch/#uses)
   | Source: [wp-includes/rest-api/class-wp-rest-server.php:1063](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/rest-api/class-wp-rest-server.php#L1063-L1129)

1 [2](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/page/2/?output_format=md)

 [Next Page](https://developer.wordpress.org/reference/files/wp-includes/rest-api/class-wp-rest-server.php/page/2/?output_format=md)