我正在为 pinterest 实现 oauth 并能够获取访问代码,但是当我尝试执行 GET/v1/me/
时,我在 chrome 控制台中收到此错误 -
XMLHttpRequest cannot load https://api.pinterest.com/v1/me?oauth_token=XXXXX&v=20121125. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://localhost:3000' is therefore not allowed access.
一般来说,我知道它与服务器端启用 CORS 的 header 设置有关,但我想具体知道如何使其适用于 pinterest。
最佳答案
似乎您尚未在 pinterest 开发人员部分将您的 URL ( https://localhost:3000 ) 列入白名单,该部分要求您指定重定向 URL。 希望这有帮助!
关于javascript - 请求的资源上不存在 'Access-Control-Allow-Origin' header 。 - Pinterest oauth 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36559308/