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