CPU Data

FREEMIUM
By Ian Karanja | Updated a month ago | Database
Popularity

7.7 / 10

Latency

403ms

Service Level

100%

Health Check

N/A

Back to All Discussions

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 …

Join in the discussion - add comment below:

Login / Signup to post new comments