In the following example, let's say that a ServiceCallout policy is in the API proxy request,
and the callout response contains multiple headers of the same name
(Set-Cookie
). Assuming the Service Callout's response variable is the default
calloutResponse
, the following policy gets the second Set-Cookie
header value.
<AssignMessage name="AM-Payload-from-SC-header"> <Set> <Payload contentType="application/json"> {"Cookies from Service Callout":" {calloutResponse.header.Set-Cookie.2}"} </Payload> </Set> <IgnoreUnresolvedVariables>true </IgnoreUnresolvedVariables> <AssignTo>response</AssignTo> </AssignMessage>
To list all header values, use the following variable instead:
{calloutResponse.header.Set-Cookie.values}