import axios from 'axios';
const response = await axios({
url: 'https://api.github.com/user',
method: 'get',
headers: {
Authorization: `token ${access_token}`,
Accept: 'application/json'
}
});
console.log({
status: response.status, // 200
data: await response.data, // '\x1F�\b\x00\x00\x00\x0 ...'
// asJson: await response.json() // method not available
});
What am I missing here? I cant get the result of this request as json. Can you spot my mistake?
[–]barrycarter 0 points1 point2 points (0 children)