SetHeaders component
The SetHeaders component is used to set headers on a message. A message passing through a flow consists of a body
, headers
and properties
. The body
contains the actual contents of the message (also called the payload). The headers
hold metadata and are typically used internally or when executing HTTP calls.
This component cannot be used as the first component in a flow, as it expects to alter the headers of a message.
Headers are set from top to bottom. Use the
Configuration
The SetHeaders component has the following configuration options:
Header name
Specifies the name of the header you wish to set.
- Cannot contain spaces.
- Are case-insensitive: Setting a header named
subject
when aSubject
header already exists will replace the value of the existingSubject
header.
Expression type
Specifies the language of the expression.
Options
Simple
(default)XPath
JsonPath
Groovy
Constant
- Supports only one-line expressions.
- Use the Script component for multi-line scripts.
Constant expressions set a literal string, not its evaluated value. For example:
Using ${header.headername}
or //root/order
will set the header's value as ${header.headername}
and //root/order
, rather than resolving them.
Expression
Defines the expression that sets the value of the header.