Youtube api Youtube api“;无效的条目Id/Uri“;批量请求
我正在使用youtube api,并提出以下批量发布请求: 与正文一起:Youtube api Youtube api“;无效的条目Id/Uri“;批量请求,youtube-api,Youtube Api,我正在使用youtube api,并提出以下批量发布请求: 与正文一起: <feed xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:yt='http://gdata.youtube.com/schemas/2007'>
<feed xmlns='http://www.w3.org/2005/Atom'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:yt='http://gdata.youtube.com/schemas/2007'>
<batch:operation type="query"/>
<entry>
<batch:operation type="query"/> <id>http://gdata.youtube.com/feeds/api/videos/h5jKcDH9s64</id>
</entry>
</feed>
http://gdata.youtube.com/feeds/api/videos/h5jKcDH9s64
但是在响应中出现了错误。部分响应:
<title>Error</title>
<content>Invalid entry Id/Uri</content>
<batch:operation type='query'/>
<batch:status code='400' reason='Invalid entry Id/Uri'/>
错误
无效的条目Id/Uri
单个GET请求:
工作正常
有人知道问题出在哪里吗?您没有发布到正确的URL。要批量请求视频条目,您需要发布到
https://gdata.youtube.com/feeds/api/videos/batch?v=2
请求主体应该如下所示
<feed xmlns='http://www.w3.org/2005/Atom'
xmlns:batch='http://schemas.google.com/gdata/batch'>
<batch:operation type="query"/>
<entry>
<id>http://gdata.youtube.com/feeds/api/videos/VIDEO_ID</id>
</entry>
<entry>
<id>http://gdata.youtube.com/feeds/api/videos/VIDEO_ID</id>
</entry>
</feed>
http://gdata.youtube.com/feeds/api/videos/VIDEO_ID
http://gdata.youtube.com/feeds/api/videos/VIDEO_ID