I'm trying to perform a GET request using Node's native https module and a 3rd party axios module (which is pretty commonly used):
const endpoint = 'https://www.pathofexile.com/api/trade/data/stats';
require('axios')
.get(endpoint)
.then(response => console.log('axios', response.status));
// prints 200
require('https')
.get(endpoint, {},
response => console.log('https', response.statusCode));
// prints 403
The axios request works fine as expected; I can view response.data as well.
But the https request fails with a 403.
- Strangely, both used to work last time I checked a few months ago.
- I haven't updated Node on my machine (node v 14.5.0). I've also tried on another machine as well (13.3.0).
curlfrom the command line also works fine.
Since https used to work, my hunch is that the server must have changed something, and that https.get and axios.get must be doing something slightly differently (e.g. sending different headers by default) that the server is no longer indifferent to.