WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp remote head

Description

Retrieve the raw response from the HTTP request using the HEAD method.

Usage

 <?php wp_remote_head$url$args ); ?> 

Parameters

$url
(string) (required) Universal Resource Locator (URL).
Default: None
$args
(array) (optional) See HTTP_API#Other_Arguments for argument details. Note: If sending any array arguments (headers, cookies, etc.) then all of them must be included since array arguments are not "deep" merged.
Default: method: HEAD, timeout: 5, redirection: 5, httpversion: 1.0, blocking: true, headers: array(), body: null, cookies: array()

Return Values

(Array) 
The response or WP_Error on failure.
Array
(
    [headers] => Array
        (
            [date] => Thu, 30 Sep 2010 15:16:36 GMT
            [server] => Apache
            [x-powered-by] => PHP/5.3.3
            [x-server] => 10.90.6.243
            [expires] => Thu, 30 Sep 2010 03:16:36 GMT
            [cache-control] => Array
                (
                    [0] => no-store, no-cache, must-revalidate
                    [1] => post-check=0, pre-check=0
                )

            [vary] => Accept-Encoding
            [content-length] => 1641
            [connection] => close
            [content-type] => application/php
        )
    [body] => null
    [response] => Array
        (
            [code] => 200
            [message] => OK
        )

    [cookies] => Array
        (
        )

)

Change Log

Since: 2.7.0

Source File

wp_remote_head() is located in wp-includes/http.php