Ok so I’m having trouble with this Bing API. I can’t seem to get the ajax call right. I’m using react and superagent
handleTermChange(term) {
const url =http://api.cognitive.microsoft.com/bing/v7.0/search?q=${term.replace(/\s/g, )}
;
request.get(url)
.set({‘Ocp-Apim-Subscription-Key’: ‘myapikey’})
.then((err, res) => {
this.setState({ searchResults: res.body.data })
});
}
I’ve gone over the documentation here is the link to the azure website: https://docs.microsoft.com/en-us/azure/cognitive-services/bing-web-search/quickstarts/nodejs
Can anyone help or direct me in the right path? Thanks