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

store request body in variable and use it later.

Not applicable

I have an proxy. i am using service call out and JavaScript policy.

Here is my requirement.

1. user sending one Json request body i want to store this request in variable. use is later.

2. I have Service call out policy and constructing new json request for callout. getting bool value true/false

3. Now after callout bool value true I need to pass same request to which we have saved at point one.

4. But My request is always override with point 2 request (service callout request).

I am using java script to save and create request.

Saving Old request into variable like(at point 1)

context.setVariable("UserAccess.Request",'request.content');

setting new request in Service callout (Point 2).

var finalRequest='';

finalRequest={"username"="abc"}

context.setVariable("request.content", JSON.stringify(finalRequest));

Now i am trying to use UserAccess.Request variable value but that is override but new request automatically

Plz help

0 1 1,585
1 REPLY 1