Amazon

부분 유료
분류별 Gautruche | 업데이트됨 11일 전 | eCommerce
인기

9.8 / 10

지연 시간

5,986ms

서비스 수준

100%

모든 토론으로 돌아가기

Parse Error: Invalid header token

avatar
shalevshir
5달 전

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 😃

avatar
b2g.corporation commented 5달 전

Hello,

Did you have test the fix indicated in the following post => https://rapidapi.com/b2g.corporation/api/amazon24/discussions/25736 ?

Best regards,

avatar
shalevshir commented 5달 전

Yes I have, as you can see It’s part of my code snippet

avatar
shalevshir commented 5달 전

also tried to update node and now I’m getting Deprecation Warning: Access to process.binding(‘http_parser’) is deprecated
Any ideas?

avatar
b2g.corporation commented 5달 전

To facilitate the communication.
Can you contact me by skype => b2g.corporation@gmail.com or by telegram => https://t.me/+pdiEB21pb6ozNGQ0 ?

Thank you

avatar
b2g.corporation commented 5달 전

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,

avatar
shalevshir commented 5달 전

Yes!! It’s working now, Thank you so much!

avatar
b2g.corporation commented 5달 전

Your welcome.
If you need more information, or custom implementation don’t hesitate to contact me by skype or telegram.

Best regards,

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입
등급: 4 - 투표: 1