Aram Khachatrian
Aram Khachatrian

Reputation: 49

WSO2 read property from the incoming request header

I am trying to understand how I can read a property from the incoming request header. What type of mediators do I have to access incoming request Headers?

Upvotes: 1

Views: 564

Answers (2)

Dilan Premarathna
Dilan Premarathna

Reputation: 1294

You can refer to the documentation: Synapse XPath Variable $trp

<property name="stockprop" expression="$trp:Content-Type"/>

See also: how to read HTTP headers in ESB

Upvotes: 3

ophychius
ophychius

Reputation: 2653

The easiest way to read incoming request headers is to use a property mediator and with the scope set to transport.

For example for a request header called TestHeader:

<property name=”TestHeaderValue” expression=”get-property(‘transport’,’TestHeader’)”/>
or
<property name=”TestHeaderValue” expression=”$trp:TestHeader”/>

Upvotes: 2

Related Questions