javascript Instagram登录Access-Control-Allow-Origin错误

问题描述 投票:0回答:1

我按照client login on Instagram的步骤,我在instagram client manager上配置了我的应用程序

我的webapp遵循以下步骤:

  1. 我改变了https://api.instagram.com/oauth/authorize/?client_id=<MY_CLIEND_ID>&redirect_uri=http://localhost:8080/&response_type=code的网址
  2. 我授权我的webapp
  3. 网址变成http://localhost:8080/?code=<INSTAGRAM_ACCESS_TOKEN>
  4. 我打电话给(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.
javascript login instagram instagram-api
1个回答
0
投票

尝试使用CORSA API调用相同的Ajax,前缀为“https://cors-anywhere.herokuapp.com/”+ URL,添加CORSA应该可以轻松绕过CORS。 :)

© www.soinside.com 2019 - 2024. All rights reserved.