Dalam contoh berikut, misalkan kebijakan ServiceCallout ada dalam permintaan proxy API,
dan respons callout berisi beberapa header dengan nama yang sama
(Set-Cookie). Dengan asumsi variabel respons Service Callout adalah calloutResponse
default, kebijakan berikut akan mendapatkan nilai header Set-Cookie
kedua.
<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>
Untuk mencantumkan semua nilai header, gunakan variabel berikut:
{calloutResponse.header.Set-Cookie.values}