WP_HTTP_Requests_Response::set_headers() WordPress Method

The set_headers() method is used to set the headers for the HTTP response. The headers are set as an array of key/value pairs. The keys are the header names and the values are the header values.

WP_HTTP_Requests_Response::set_headers( array $headers ) #

Sets all header values.


Parameters

$headers

(array)(Required)Map of header name to header value.


Top ↑

Source

File: wp-includes/class-wp-http-requests-response.php

	public function set_headers( $headers ) {
		$this->response->headers = new Requests_Response_Headers( $headers );
	}

Top ↑

Changelog

Changelog
VersionDescription
4.6.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.