Json returned from flickr api without getting parsed

I am trying to use flickr api and request data in json format from node.js. I provide nojsoncallback=1that the returned json is not wrapped inside the jsonp callback. Here is the URL http://api.flickr.com/services/feeds/photos_public.gne?format=json&nojsoncallback=1 .

Json returned incorrectly formatted and JSON.parsecannot parse it. If I do not pass nojsoncallbackthe request parameter and the evalresponse that calls the function jsonFlickrFeed, it receives correctly eval, and I get the object. I also notice that the title is Content-typein the answer application/x-javascript; charset=utf-8. I suspect that special characters are doubled in the returned answer.

I do not want evalwhat can I do to correctly convert the response to a string and then parse it?

By the way, with the simplest use case. No modules, no intermediaries. gist

+4
source share

All Articles