I have one proxy End point added Flow in request and In flow using JavaScript to construct Json Request Payload. No target serve/end point define.
like belw
var req = JSON.parse(request.content); var finalRequest = { Payer: req.payerID, UserName:UserNameVal}; request.content = ''; //To clear the request payload request.content = JSON.stringify(finalRequest);
now i want send that constructed request content to the new target server with Verb Post.
Plz help. thanks in advance
Solved! Go to Solution.
@Madhav , Looks like you are using the variable "myRequest" in SC policy which is not defined. Make the below changes in JS and SC policies and try again.
var req = JSON.parse(context.getVariable("request.content")); var finalRequest = { "Payer": req.payerID, "UserName":"UserNameVal"}; //To clear the request payload context.setVariable("request.content", JSON.stringify(finalRequest));
2. Change the request variable name "request" instead of "myRequest" in SC policy.