Yql Odt - Rest Get Response Exists But Inaccessible
Solution 1:
I have found my solution and this may be a bug in the YQL server.
What happens is that when a web service returns content with content-type 'application/json', YQL parses it into the E4X format, an xml representation for JavaScript. Why it does so, I do not have any clue on since JSON should be parsed into a JavaScript object.
The problem with this E4X format seems to be that it is only accessible within the optional callback function that can be supplied when calling y.rest().
When trying to store bits of data into a variable, and apply it to the response.object object, I found that the console would return a NOT FOUND error. This means that what I thought I had stored into my variables was not a string or integer value for these social button counts, but a reference to an E4X node.
To solve this problem, I performed parseInt magic on the node to get my numbers.
I believe this behaviour is very odd and is most likely an unintended bug. Hopefully, a developer will pick up on this issue to prevent future confusions.
Post a Comment for "Yql Odt - Rest Get Response Exists But Inaccessible"