【发布时间】:2015-12-04 07:09:02
【问题描述】:
我正在尝试向 facebook 的 oembed 发出 XHR 请求,但遇到了 CORS 错误。有人知道这是否是因为 Facebook 不允许对 oembed 端点的 CORS 请求?如果是这样,为什么不允许呢?端点应该在浏览器之外使用吗?
XMLHttpRequest cannot load https://apps.facebook.com/plugins/
post/oembed.json/?url=https://www.facebook.com/notes/mark-zuckerberg/
a-letter-to-our-daughter/10153375081581634.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:8000' is therefore not allowed access.
我也在与其他供应商达成同样的目标:YouTube、Twitter、Vine、Instagram。有些人似乎允许这样做:Vimeo 和 Soundcloud。
【问题讨论】:
-
您似乎没有使用他们的 oEmbed URL 之一:developers.facebook.com/docs/plugins/oembed-endpoints
标签: javascript facebook cors oembed