This is how I assigned
context.setVariable("response.content", response);
but in the trace session i could fine response.content =""org.mozilla.javascript.Undefined@*******:
Solved! Go to Solution.
Multiple issues found in your proxy ,
var result; context.setVariable("result",JSON.stringify(employees)); context.setVariable("response.content", result);
Above code actually assign empty variable "result" to "response.content"
It should be,
context.setVariable("result",JSON.stringify(employees)); context.setVariable("response.content", context.getVariable("result"));
Find more about same in docs here,
respcontent-rev2-2016-06-21.zip
Sample API call,
curl -X POST -H "Cache-Control: no-cache" -H "Postman-Token: c693e22c-d223-093a-0031-13f792caf87d" -d '{"accountingFrom": [ { "firstNameFrom" : "Johnny", "lastNameFrom" : "Doe", "ageFrom" : 23 }, { "firstNameFrom" : "Mary", "lastNameFrom" : "Smith", "ageFrom" : 32 } ] }' "http://anildevportal-test.apigee.net/sample"
Hope it helps, Keep us posted moving forward if any query regarding Apigee.
This is how I assigned
context.setVariable("response.content", response);
but in the trace session i could fine response.content =""org.mozilla.javascript.Undefined@*******:
@surekapoppy@gmail.com , Welcome to Apigee Communty.
Can you please provide more details to better understand your issue ? What is your Proxy Doing ? What is code you have used in Javascript ? What do you mean by "location" ? Above question in current form is difficult to answer. Please update your question with more details
@surekapoppy@gmail.com , Flow variable response.content is available out of the box ? Why are you resetting it with response object ? Above issue is expected when you do that. Am i missing something here ?
@surekapoppy@gmail.com , Can you attach a sample proxy to reproduce your issue ?
Please find the sample proxy attached
@surekapoppy@gmail.com , Can you also post sample request you are sending ?
{"accountingFrom": [ { "firstNameFrom" : "Johnny", "lastNameFrom" : "Doe", "ageFrom" : 23 }, { "firstNameFrom" : "Mary", "lastNameFrom" : "Smith", "ageFrom" : 32 } ] }
Multiple issues found in your proxy ,
var result; context.setVariable("result",JSON.stringify(employees)); context.setVariable("response.content", result);
Above code actually assign empty variable "result" to "response.content"
It should be,
context.setVariable("result",JSON.stringify(employees)); context.setVariable("response.content", context.getVariable("result"));
Find more about same in docs here,
respcontent-rev2-2016-06-21.zip
Sample API call,
curl -X POST -H "Cache-Control: no-cache" -H "Postman-Token: c693e22c-d223-093a-0031-13f792caf87d" -d '{"accountingFrom": [ { "firstNameFrom" : "Johnny", "lastNameFrom" : "Doe", "ageFrom" : 23 }, { "firstNameFrom" : "Mary", "lastNameFrom" : "Smith", "ageFrom" : 32 } ] }' "http://anildevportal-test.apigee.net/sample"
Hope it helps, Keep us posted moving forward if any query regarding Apigee.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |