I tried
var resheader = context.getVariable("calloutResponse.header");
but i am not bale to see the headers which is coming from back end ,
Can anyone know how can we fetch the headers from callout response?
Thanks,
Ambili
Solved! Go to Solution.
Here is a JSC snippet that will print all the headers in the response:
var headerNames = context.getVariable("response.headers.names") + ""; headerNames.split(", ").sort().forEach(function(headerName) { if (headerName) print(headerName+":"+context.getVariable("response.header."+headerName)); });
Change the name of response.headers to whatever you named your callout response.