Custom HTTP header
Use the Custom HTTP Header policy to add or modify HTTP headers on the outgoing message and enable routing decisions based on those headers.
In IBM API Studio, this policy is identified by
the kind Set.
Example of a Custom HTTP header policy:
kind: Set
apiVersion: api.ibm.com/v2
metadata:
name: set-request-1
version: 1.0
namespace: wm_project
spec:
messageHeader:
action: 'add' # 'combine' | 'set' | 'add'
headerName: "organisation"
value: "${request.query.QUERY_NAME}"
messageName: "default"
valueType: 'webm-var-expression' # "webm-var-expression | plain | variables" and webm-var-expression is applicable only for webM
To invoke the Custom HTTP Header policy, you can specify:
| Type | Description |
|---|---|
spec |
Defines the Custom HTTP Header policy configuration. Specifies how the policy sets or modifies HTTP headers on the outgoing message. You can configure the following policy specifications:
|