Trong ví dụ sau, giả sử chính sách ServiceCallout nằm trong yêu cầu của API proxy và phản hồi của lệnh gọi chứa nhiều tiêu đề có cùng tên (Set-Cookie). Giả sử biến phản hồi của Service Callout là calloutResponse mặc định, chính sách sau sẽ nhận được giá trị tiêu đề Set-Cookie thứ hai.
<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>
Để liệt kê tất cả các giá trị tiêu đề, hãy dùng biến sau:
{calloutResponse.header.Set-Cookie.values}