HTTP -- get HTTP headers

  • Called with the name of an HTTP request header field, returns its value. Capitalization and the use of hyphens versus underscores are not significant.
  • Request headers are sent by the browser to the server. It is not possible to access the Response headers returned to the browser.
  • Only returns headers permitted by site configuration. Returns '' if the header is not allowed.
  • When called without a parameter, nothing is returned. See VarHTTPS for other options.
ALERT! The HTTP and HTTPS macros are deprecated as of Foswiki release 2.1. and will be removed in a future release.

Parameters

Name Description
"name" Name of the header to get

Examples

Write Returns Notes
%HTTP%   Always returns ''
%HTTP{"Accept-language"}%    
%HTTP{"User-Agent"}% Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)  
%HTTP{"Cookie"}%   Not allowed by default.
ALERT! You can see the HTTP headers your browser sends to the server on a number of sites e.g. http://www.ericgiguere.com/tools/http-header-viewer.html

HTTPS, REMOTE_ADDR, REMOTE_PORT, REMOTE_USER
Topic revision: r1 - 12 Nov 2015, ProjectContributor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback