SetReqHeader

For example, taking the value of the request header 'fred' and passing it as as 'wilma' to the target API:

Example

SetReqHeader 'wilma' (requestVars 'request.header.fred')

Suppose you do not want the 'fred' header to be passed to the target. In that case, you can apply a Header policy after the transformation policy to remove the 'fred' header (for example, remove it after the header was used by the transformation policy to set the 'wilma' header).

You could also transform a query-parameter into a header:

Example

SetReqHeader 'wilma' (requestVars 'request.queryparam.p1')

Headers from POST payloads also follow this process:

Example

SetReqHeader 'credit-limit' (jsonPathValue '$.creditLimit')
Note: 

In addition to using these helpers to manipulate query-parameters and headers, you must make sure your transformation leaves the POST request or response payload.

A transformation policy that has only SetReqQuery, SetReqHeader, or SetResHeader helpers in it would leave the payload empty.