CPU Data

免费增值
通过 Ian Karanja | 已更新 a month ago | Database
人气

8.1 / 10

延迟

532ms

服务等级

100%

Health Check

N/A

返回所有讨论

Error: Parse Error: Invalid header token

Rapid account: Alanngo
alanngo
2 years ago
var options = {
    method: 'GET',
    url: 'https://cpu-data.p.rapidapi.com/cpus',
    headers: {
      'x-rapidapi-host': 'cpu-data.p.rapidapi.com',
      'x-rapidapi-key': '3b1a72ccdemsh3c7f0914fef948bp10cf67jsna19641d4c3fc'
    }
  };
  
  axios.request(options).then(function (response) {
      console.log(response.data);
  }).catch(function (error) {
      console.error(error);
  });
	```
	
	the error occurs when running this app on my computer
Rapid account: Ranjian 0
ranjian0 Commented a year ago

Resolved

Rapid account: Ranjian 0
ranjian0 Commented 2 years ago

Just tested the endpoint with similar code and got the expected result.

var axios = require("axios").default;

var options = {
  method: 'GET',
  url: 'https://cpu-data.p.rapidapi.com/cpus',
  headers: {
    'x-rapidapi-host': 'cpu-data.p.rapidapi.com',
    'x-rapidapi-key': 'XXXXXXXXXXXXXXXXXXXXXXXXXX'
  }
};

axios.request(options).then(function (response) {
	console.log(response.data);
}).catch(function (error) {
	console.error(error);
});

Is your header key valid?

Rapid account: Ranjian 0
ranjian0 Commented 2 years ago

Investigating …

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论