0
当联系时的Embedly API这样与404响应:Embedly API使用多个URL
$.getJSON('https://api.embedly.com/1/oembed?' + $.param({
url: 'http://example.com/article-1',
key: "myapikey"
}));
我获取嵌入数据。但是当我试图用多个URL这样做:
$.getJSON('https://api.embedly.com/1/oembed?' + $.param({
urls: 'http://example.com/article-1,http://example.com/article-2,http://example.com/article-3',
key: "myapikey"
}));
我从API称该网址的错误响应未发现:
[
{
"url": "http://example.com/article-1,http://example.com/article-2,http://example.com/article-3",
"error_code": 404,
"error_message": "HTTP 404: Not Found",
"type": "error",
"version": "1.0"
}
]
的可能的复制http://stackoverflow.com/questions/20148239/use-multiple-urls-with-getjson。您必须进行单独的$ .getJSON调用。 – allu
那么,因为只有一个URL被提供时,API响应正确,因此对每个URL分别调用都是可行的。但根据[Embedly文档](http://docs.embed.ly/docs/oembed),支持同一API调用中的多个URL,并且是并行处理,这是我想要利用的功能。 –
你是对的,它应该像你描述的那样工作。我没有设法找到任何使用示例。你有没有尝试过jQuery插件https://github.com/embedly/embedly-jquery。在那里我看到了使用多个网址的方法。 – allu