The set-header policy assigns a value to an existing response and/or request header or adds a new response and/or request header.
Inserts a list of HTTP headers into an HTTP message. When placed in an inbound pipeline, this policy sets the HTTP headers for the request being passed to the target service. When placed in an outbound pipeline, this policy sets the HTTP headers for the response being sent to the gateway’s client.
Multiple values of a header are concatenated to a CSV string, for example:headerName: value1,value2,value3
Exceptions include standardized headers, which values:
may contain commas (User-Agent,WWW-Authenticate,Proxy-Authenticate),
may contain date (Cookie,Set-Cookie,Warning),
contain date (Date,Expires,If-Modified-Since,If-Unmodified-Since,Last-Modified,Retry-After).
In case of those exceptions, multiple header values will not be concatenated into one string and will be passed as separate headers, for example:User-Agent: value1User-Agent: value2User-Agent: value3
Specifies the value of the header to be set. For multiple headers with the same name add additional value elements.
Specifies what action to take when the header is already specified. This attribute must have one of the following values:
override – replaces the value of the existing header,
skip – does not replace the existing header value,
append – appends the value to the existing header value,
delete – removes the header from the request.
When set to override enlisting multiple entries with the same name results in the header being set according to all entries (which will be listed multiple times); only listed values will be set in the result.
Specifies name of the header to be set.
This policy can be used in the inbound, outbound, and on-error policy scopes.