Skip to main content

 Advanced

Advanced topics

Generator: GetRequestHeaders

Class name:org.weborganic.bastille.http.GetRequestHeaders
Version:0.6.7 - 31 May 2011
Library:Bastille
Cacheable:No
Generated:2012-12-21

Description

This generator returns the HTTP request headers as XML.

Configuration

The root XML folder can be configured globally using the Berlioz configuration:

For example:

<node name="bastille">
  <map/>
  <node name="http">
    <map>
      <entry key="headers" value="User-Agent,Accept-Language"/>
    </map>
  </node>
</node>

Parameters

The match parameter can be used to specify which headers should be displayed as a comma-separated list. If null or equal to "", all HTTP headers are returned.

Returned XML

XML for a file: 

<http-headers match="[header-match]">
  <header name="[header-name]" value="[header-value]"/>
  <header name="[header-name]" value="[header-value]"/>
  <header name="[header-name]" value="[header-value]"/>
  <header name="[header-name]" value="[header-value]"/>
  <header name="[header-name]" value="[header-value]"/>
  ...
</http-headers> 

Note: this generator does not return anything if the content request is not made from an HTTP request.

Created on , last edited on