I Github API in Meteor wurde mit, konnte aber dieses Problem nicht gelöst:Github API nicht unterstützten Medientyp 415
Dieser Code versucht, die Gesamtzahl der Verkehr für eine bestimmte Repo zu bekommen.
HTTP.call('GET', 'https://api.github.com/repos/hackmdio/hackmd/traffic/views',
{
headers:
{
'Content-Type':'application/json',
"Accept":"application/vnd.github.v3+json",
"User-Agent": "whales"
},
},
function(error, response) {
if (error) {
console.log('---------------------------error occurred-----------------------------------')
console.log('---------------------------error occurred-----------------------------------')
console.log(error);
} else {
console.log('--------------------------data got it!!-------------------------------------')
console.log('--------------------------data got it!!-------------------------------------')
console.log(response);
}
});
Fehler:
{
"message": "If you would like to help us test the Repo Traffic API during its preview period, you must specify a custom media type in the 'Accept' header. Please see the docs for full details.",
"documentation_url": "https://developer.github.com/v3"
}
ich für ähnliche Probleme gesucht und fügte hinzu: "Content-Type" und "Accept" aber es funktioniert immer noch nicht.
Ich versuchte es dann in Postman und auch im Terminal mit den gleichen Headern, aber dieser Fehler ist passiert.
Vielen Dank.