goferito / node-bing-api

Node.js module for the Bing Search API (Cognitive Services)
MIT License
56 stars 28 forks source link

JSON.parse( body ) is not working #5

Closed sagarkarira closed 9 years ago

sagarkarira commented 9 years ago

I was trying search an image using this api . When I use "console.log( body )" it outputs the incoming information for that image which is a valid JSON . But when I try to parse is using JSON.parse(body) it give an error " SyntaxError: Unexpected token o at Object.parse (native) "

goferito commented 9 years ago

Body is already an object. The library already parses the response for you. You don't need to parse it again.

sagarkarira commented 9 years ago

Thanks . Its working now .