Post Reply 
Author asyncRequest retrieves JSON as plain text
nicolast
Member

Find all posts by this user
Quote this message in a reply
Default  4 March 2014 18:01
Hello,

When making a GET request that returns a JSON file, using aria.core.IO.asyncRequest, the JSON content is placed in the responseText property of the response object, instead of responseJSON.

I checked the http response, and the file is actually served with the application/json content-type.

Could that be an Aria Templates bug?

Thank you!
jakub-g
AT core team member

Find all posts by this user
Quote this message in a reply
Default  5 March 2014 15:57
Hi @nicolast,

On your request object, you should put "expectedResponseType" : "json"

http://ariatemplates.com/aria/guide/apps...RequestCfg

(not all the properties of the request are documented inline in the http://ariatemplates.com/aria/guide/apps...est:method jsdoc). This is important enough though to be included there - thanks for the report.

Let us know if this solved the issue!

http://jakub-g.github.io/
(This post was last modified: 5 March 2014 16:00 by jakub-g.)
nicolast
Member

Find all posts by this user
Quote this message in a reply
Default  5 March 2014 16:10
It actually solved the issue, thank you!
jakub-g
AT core team member

Find all posts by this user
Quote this message in a reply
5 March 2014 17:36
Cool, thanks for feedback Smile

http://jakub-g.github.io/
Post Reply