WP_REST_Request::get_headers() WordPress Method

The WP_REST_Request::get_headers() method is used to retrieve the headers for a request. Headers are an important part of a request, and can be used to determine the format of the data being sent, the type of data being sent, and other important information. This method can be used to retrieve the headers for a request, and can be used to determine the format of the data being sent, the type of data being sent, and other important information.

WP_REST_Request::get_headers() #

Retrieves all headers from the request.


Return

(array) Map of key to value. Key is always lowercase, as per HTTP specification.


Top ↑

Source

File: wp-includes/rest-api/class-wp-rest-request.php

	public function get_headers() {
		return $this->headers;
	}

Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.