{{ request.headers }}

The headers object is available on every page, and contains information regarding the headers sent with the request that may be useful for serving and rendering the page.

Properties

Specific headers may be accessed using {{ request.headers.headername }} or {{ request.headers['header-name'] }}.

You may also treat this object as a list containing all of the header names which may be iterated using a {% for %} loop. For more details, see the examples below:

Field Type Description
object_type string "headers"
is_valid true/false Will always be true
keys List A list of all of the individual header names sent with the request
count number The number of headers sent with the request

Examples

Request Origin

Copy
Origin: {{ request.headers.origin }}

Looping Request Headers with Key

Copy
{% for key in request.headers.keys %} {{ key }}: {{ request.headers[key] }} {% endfor %}

Loop Request Headers

Copy
{% for header in request.headers %} {{ header }}: {{ request.headers[header] }} {% endfor %}