Reputation: 817
I want to use an API (that doesn't support CORs) in my NodeJS app.
Actually it's not really an API. A site uses that link to get the data.
I have downloaded a browser extension which lets me access the API. Is there any way I can access it in my NodeJS app, like by tweaking the Http header?
I use request module to send request.
var request = require('request');
var options = {
url: 'http://kalimatimarket.gov.np/priceinfo/dlypricebulletin',
method: 'POST',
data : "cdate=07/01/2017&pricetype=R"
// do something to allow cors
};
request(options, (err, res, body)=> {
console.log(body)
});
Upvotes: 0
Views: 744
Reputation: 6729
Allow-Control-Allow-Origin
on the server site indicating the client url, orjsonp
Upvotes: 1