I am working with Retrieve and Rank service of IBM Watson. This service provides a REST API that returns search result. Following is the API URL
https://username:[email protected]/retrieve-and-rank/api/v1/solr_clusters/sc6e46e4f5_f30c_4a8a_ae9c_b4ab6914f7b4/solr/example-collection/select?q=some question&wt=json&fl=id,title,body
As yo can notice this URL takes in a user name and a password. The Retreive and Rank documentation mentions the above pattern for calling the API, i.e, with user name and password as part of the URL. If I paste this in google chrome, it comes out with dialog box to enter user name and password again. After I enter the credentials I can see the data.
My question is, how do I call such a URL through Node.js. I do not know where do I start and what steps I should follow.
API of Retrieve and Rank service of IBM Watson uses basic authentication. Ways are several, one of them - use the module
request
:or