wp_remote_retrieve_header

Advertisement

Summery Summery

Retrieve a single header by name from the raw response.

Syntax Syntax

wp_remote_retrieve_header( array|WP_Error $response, string $header )

Parameters Parameters

$response

(Required) HTTP response.

$header

(Required) Header name to retrieve value from.

Return Return

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

Source Source

File: wp-includes/http.php

		return '';
	}

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

	return '';
}

/**

Advertisement

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Advertisement

Leave a Reply