wp_remote_retrieve_headers( array $response )

Retrieve only the headers from the raw response.

Description Description

See also See also

Top ↑

Parameters Parameters


(array) (Required) HTTP response.

Top ↑

Return Return

(array|Requests_Utility_CaseInsensitiveDictionary) The headers of the response. Empty array if incorrect parameter given.

Top ↑

Source Source

File: wp-includes/http.php

function wp_remote_retrieve_headers( $response ) {
	if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
		return array();

	return $response['headers'];

Top ↑

Changelog Changelog

Version Description
4.6.0 Return value changed from an array to an Requests_Utility_CaseInsensitiveDictionary instance.
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.