Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Extract service callout response content with http status code 302

Hi.
I am using service callout policy inside of a proxy to make call to a target endpoint. Service callout policy returns response with http status code 302. How to access the response variable content in ExtractVariables or JavaScript policy? I am unable to access the variable.

0 2 399
2 REPLIES 2

ganadurai
Former Googler

HTTP 302 is indicating the request invoker to send the request to the URI thats in the response Location header. 

You can access the response content and headers as described in docs. Either find the correct ServiceCallout target and use that in your Apigee proxy OR extract the Location value from the ServiceCallout response and make subsequent calls to the target identified (not an ideal solution).

Thanks. 

I am using service callout to simulate callback request. But the service callout is returning another callback with http status code 302.