hello,
this is my code:
var axios = require(“axios”).default;
process.binding(
‘http_parser’
).HTTPParser = require(‘http-parser-js’).HTTPParser;
var options = {
method: ‘GET’,
url: ‘https://amazon24.p.rapidapi.com/api/product/B01MRH7MR4’,
headers: {
‘x-rapidapi-host’: ‘amazon24.p.rapidapi.com’,
‘x-rapidapi-key’: process.env.API_KEY
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
And no matter what I do, I keep getting Parse Error: Invalid header token
also tried -
var axios = require(“axios”).default;
axios.get(‘https://amazon24.p.rapidapi.com/api/product/B01MRH7MR4?rapidapi-key=’ + process.env.API_KEY).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
Putting the URL directly in the browser works but not in NodeJs
Please help
Thank you 😃
아래에 의견을 추가하고 토론에 참여하세요.
Hello,
Did you have test the fix indicated in the following post => https://rapidapi.com/b2g.corporation/api/amazon24/discussions/25736 ?
Best regards,
Yes I have, as you can see It’s part of my code snippet
also tried to update node and now I’m getting Deprecation Warning: Access to process.binding(‘http_parser’) is deprecated
Any ideas?
To facilitate the communication.
Can you contact me by skype => b2g.corporation@gmail.com or by telegram => https://t.me/+pdiEB21pb6ozNGQ0 ?
Thank you
Hello,
I have to find the problem, and It’s a RapidAPI bug. I have fixed the trouble to remove the brackets in the name of objects for the subscription.
Please unsubscribe and resubscribe, and you will use the API without a problem.
Best regards,
Yes!! It’s working now, Thank you so much!
Your welcome.
If you need more information, or custom implementation don’t hesitate to contact me by skype or telegram.
Best regards,