WordPress at a glance
Home All Function Functions APIs HTTP API

wp_remote_retrieve_header() WP 1.0

Retrieve a single header by name from the raw response.

No Hooks.


String. The header value. Empty string on if incorrect parameter given, or if the header doesn't exist.


wp_remote_retrieve_header( $response, $header );
$response(array) (required)
$header(string) (required)
Header name to retrieve value from.

Code of wp remote retrieve header: wp-includes/http.php VER 5.0.3

function wp_remote_retrieve_header( $response, $header ) {
	if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) {
		return '';

	if ( isset( $response['headers'][ $header ] ) ) {
		return $response['headers'][$header];

	return '';

Related Functions

From tag: HTTP API (curl remote)

No comments
    Hello, !     Log In . Register