(Quick Reference)

headers

Purpose

Obtains the value of a named header

Examples

Reading a header’s value:

Format: <g:header name="Content-Type" />

Or testing for existence:

<g:if test="${header(name: 'User-Agent')}">Hello</g:if>

Description

Attributes

  • name - The name of the header