我遵循针对client login on Instagram的步骤,我在instagram client manager上配置了我的应用程序
我的webapp遵循以下步骤:
我在https://api.instagram.com/oauth/authorize/?client_id=<MY_CLIEND_ID>&redirect_uri=http://localhost:8080/&response_type=code
我授权了我的网络应用程序
该网址变为http://localhost:8080/?code=<INSTAGRAM_ACCESS_TOKEN>
我打电话(Ajax GET请求)https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=<INSTAGRAM_ACCESS_TOKEN>
但我收到此错误:
Failed to load https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=INSTAGRAM_ACCESS_TOKEN : Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response.
答案 0 :(得分:0)
尝试使用CORSA API(前缀“ https://cors-anywhere.herokuapp.com/” + URL)调用同一Ajax,添加CORSA应该可以轻松绕过CORS。 :)