WordPress at a glance

wp_get_http_headers() WP 1.0

Retrieve HTTP Headers from URL.

No Hooks.

Return

true/false/String. False on failure, headers on success.

Usage

wp_get_http_headers( $url, $deprecated );
$url(string) (required)
URL to retrieve HTTP headers from.
$deprecated(true/false)
Not Used.
Default: false

Code of wp_get_http_headers: wp-includes/functions.php VER 4.9.8

<?php
function wp_get_http_headers( $url, $deprecated = false ) {
	if ( !empty( $deprecated ) )
		_deprecated_argument( __FUNCTION__, '2.7.0' );

	$response = wp_safe_remote_head( $url );

	if ( is_wp_error( $response ) )
		return false;

	return wp_remote_retrieve_headers( $response );
}

Related Functions

From tag: HTTP API (curl remote)

No comments
    Hello, !     Log In . Register