Hi, I have created a test app on JSBin in order to test requests to the API but i all i receive is an Access-Control-Allow-Origin alert. How can I allow my app to connect successfully to the API ?
Here is my request : xhr.open("GET", "https://api.themoviedb.org/3/movie/550?api_key=[key]");
Here is the alert : XMLHttpRequest cannot load https://api.themoviedb.org/3/movie/550?api_key=[key]. Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true.
Thank you.
找不到电影或节目?登录并创建它吧。
Travis Bell 的回复
于 2016 年 11 月 21 日 1:16下午
Hi @tocausan
You need to use JSONP with a callback. Here's a jQuery example (just make sure to swap out your API key).
tocausan 的回复
于 2016 年 11 月 22 日 4:18上午
Thanks a lot !