【发布时间】:2014-10-20 15:52:40
【问题描述】:
当我使用 yammer API 请求数据时,有时我会得到 hte 数据,而有时我会收到错误提示
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.yammer.com/api/v1/topics/4990456.json?&_=1409122520954. This can be fixed by moving the resource to the same domain or enabling CORS.
当我尝试使用 URL :https://www.yammer.com/api/v1/topics/4990456.json 获取主题号 4990456 的消息时,我在控制台日志中收到上述错误。
同样,当我尝试 URL : https://www.yammer.com/api/v1/messages/about_topic/ 时,我再次在控制台日志中收到上述错误。
但是,从同一页面、同一域、同一代码,如果我请求 https://api.yammer.com/api/v1/messages/my_feed.json ,我会收到回复。
有人可以解释一下这种差异吗?这是获取主题消息的正确方法吗?
【问题讨论】:
标签: javascript cors yammer