Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to set window.location in apigee javascript policy

Not applicable

How to set window.location in apigee javascript policy? As window.location= <url> not working in JS policy. please give me some way to change the location in browser.

Solved Solved
1 4 690
1 ACCEPTED SOLUTION

Setting window.location makes sense for JS code that runs within the browser.

The JS code in Apigee Edge obviously doesn't run in the browser. It is possible, though, for a browser (via XHR) to invoke APIs or URLs managed by Apigee Edge. In that case, You can return a 302 Status Code with the Location header set to the url you want to redirect to.

https://en.wikipedia.org/wiki/HTTP_location

View solution in original post

4 REPLIES 4