I am having trouble reading the values on HTTP Request on Javascript file.
var response = httpClient.get("http://mocktarget.apigee.net/json"); var val = response.getResponse().content.asJSON; print(val);
The val on my log is printed with:
[object Object]
I tried JSON.parse the val, but it is not returning anything. I do not understand why I am not able to parse it.
Solved! Go to Solution.
Use JSON.stringify to print the data
var response = httpClient.get("http://mocktarget.apigee.net/json"); var val = response.getResponse().content.asJSON; print(JSON.stringify(val));
Use JSON.stringify to print the data
var response = httpClient.get("http://mocktarget.apigee.net/json"); var val = response.getResponse().content.asJSON; print(JSON.stringify(val));
Hi Sujnana, can you please provide the wayout to deal with XML response?
Please don't ask questions in comments to answers. You posted a toplevel question, and it has been answered.
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |