drupal_get_http_header

Versions
7
drupal_get_http_header($name = NULL)

Get the HTTP response headers for the current page.

Parameters

$name An HTTP header name. If omitted, all headers are returned as name/value pairs. If an array value is FALSE, the header has been unset.

Return value

A string containing the header value, or FALSE if the header has been set, or NULL if the header has not been set.

▾ 4 functions call drupal_get_http_header()

drupal_deliver_html_page in includes/common.inc
Package and send the result of a page callback to the browser as a normal HTML page.
drupal_page_set_cache in includes/common.inc
Store the current page in the cache.
drupal_send_headers in includes/bootstrap.inc
Send the HTTP response headers previously set using drupal_add_http_header(). Add default headers, unless they have been replaced or unset using drupal_add_http_header().
drupal_serve_page_from_cache in includes/bootstrap.inc
Set HTTP headers in preparation for a cached page response.

Code

includes/bootstrap.inc, line 938

<?php
function drupal_get_http_header($name = NULL) {
  $headers = drupal_add_http_header();
  if (isset($name)) {
    $name = strtolower($name);
    return isset($headers[$name]) ? $headers[$name] : NULL;
  }
  else {
    return $headers;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.