goferito / node-bing-api

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

When I use spell checker I get the following error #40

Open vineethsagar opened 7 years ago

vineethsagar commented 7 years ago

{"_type": "ErrorResponse", "errors": [{"code": "RequestParameterMissing", "message": "Required parameter is missing.", "parameter": "text"}]}

Bing.spelling('awsome spell', function (err, res, body) { console.log(body.flaggedTokens.suggestions[0].suggestion); //awesome spell });

vineethsagar commented 7 years ago

I found an error in your code {node.js} line no 75 var reqUri = opts.rootUri + vertical + "?q=" + query

it has to be var reqUri = opts.rootUri + vertical + "?text=" + query

goferito commented 7 years ago

Could you provide a PR with the fix?