I dont know why it dont work.... use it like that :
const url = 'https://api.themoviedb.org/3/movie/top_rated?language=en-US&page=1';
const options = {
method: 'GET',
headers: {
accept: 'application/json',
Authorization: 'Bearer MyAPIKey'
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها
هل تريد تقييم او اضافة هذا العنصر للقائمة؟
لست عضو؟
رد بواسطة Travis Bell
بتاريخ أغسطس 7, 2024 في 10:58 صباحا
You can't use your API key as a bearer token. If you want to use bearer authentication, make sure to use your access token.
You can read more about this here, in the docs: https://developer.themoviedb.org/docs/authentication-application