Getting issue with http.client.request
Hi,
We are making call to third party API call to get JSON data. However when we read the variable it throws error. Below is the code:
--------------------
<#assign req = http.client.request("https://api.abc.com/v1/rest").json() />
<#assign res = req.call("GET") />
${res}
-----------------------
If we hit the API call on browser response looks like below:
[{"Id":"88310f87-ea6f-4fec-ab4d-389d8c127b18","Category":"Bug Reports","HTML":"\u003ciframe width=\"640\" height=\"590\" src=\"https://api.abc.com/v1/rest/88310f87-ea6f-4fec-ab4d-389d8c127b18\" frameborder=\"0\" allowfullscreen webkitallowfullscreen scrolling=\"no\"\u003e\u003c/iframe\u003e","Language":{"Id":2,"Name":"English","Locale":"English","Code":"en"},"Privacy":"Public","PublishDate":"8/4/2014 11:43:48 PM","SkillLevel":"Beginner","Status":"Published","Title":"Ripple Mobile Emulator and the \"New Video Play\" issue - Not Reproducible","TimelineHeight":190},{"Id":"69c12a54-8b3d-4627-a5b7-d1e1fb5ab179","Category":"Bug Reports","HTML":"\u003ciframe width=\"640\" height=\"590\" src=\"https://api.abc.com/v1/rest/69c12a54-8b3d-4627-a5b7-d1e1fb5ab179\" frameborder=\"0\" allowfullscreen webkitallowfullscreen scrolling=\"no\"\u003e\u003c/iframe\u003e","Language":{"Id":2,"Name":"English","Locale":"English","Code":"en"},"Privacy":"Public","PublishDate":"8/5/2014 12:25:37 AM","SkillLevel":"Beginner","Status":"Published","Title":"Ripple Mobile Emulator (iPhone) and the \"New Video Play\" issue - Not Reproducible","TimelineHeight":190}]
We are able to read the if we just read it as string but then we are seeing the character conversion to ASCII. Is there a way to convert them back.Below is the code and response:
--------------------
<#assign req = http.client.request("https://api.abc.com/v1/rest") />
<#assign res = req.call("GET") />
${res}
-----------------------
Respone:
[{"Id":"88310f87-ea6f-4fec-ab4d-389d8c127b18","Category":"Bug Reports","HTML":"\u003ciframe width=\"640\" height=\"590\" src=\"https://api.abc.com/v1/rest/88310f87-ea6f-4fec-ab4d-389d8c127b18\" frameborder=\"0\" allowfullscreen webkitallowfullscreen scrolling=\"no\"\u003e\u003c/iframe\u003e","Language":{"Id":2,"Name":"English","Locale":"English","Code":"en"},"Privacy":"Public","PublishDate":"8/4/2014 11:43:48 PM","SkillLevel":"Beginner","Status":"Published","Title":"Ripple Mobile Emulator and the \"New Video Play\" issue - Not Reproducible","TimelineHeight":190},{"Id":"69c12a54-8b3d-4627-a5b7-d1e1fb5ab179","Category":"Bug Reports","HTML":"\u003ciframe width=\"640\" height=\"590\" src=\"https://api.abc.com/v1/rest/69c12a54-8b3d-4627-a5b7-d1e1fb5ab179\" frameborder=\"0\" allowfullscreen webkitallowfullscreen scrolling=\"no\"\u003e\u003c/iframe\u003e","Language":{"Id":2,"Name":"English","Locale":"English","Code":"en"},"Privacy":"Public","PublishDate":"8/5/2014 12:25:37 AM","SkillLevel":"Beginner","Status":"Published","Title":"Ripple Mobile Emulator (iPhone) and the \"New Video Play\" issue - Not Reproducible","TimelineHeight":190}]
Appreciate the help here.
Thanks,
Sachin