0

我在批处理请求中的帖子如下所示:

<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>
<id>http://gdata.youtube.com/feeds/api/users/ytUser1</id>
</entry>
<entry>
<id>https://gdata.youtube.com/feeds/api/users/ytUser2</id>
</entry>
<entry>
<id>https://gdata.youtube.com/feeds/api/users/ytUser3</id>
</entry>
</feed>

当然除了真正的用户和更多的用户。我得到的 xml 反馈很好。有没有办法使用 POST 请求 JSON 格式的数据?我知道在 GET 请求中使用 ?alt=json 会返回 json,但有可能吗?如果可以,如何在 POST 批处理请求中使用?

4

1 回答 1

0

您应该能够将 alt=json 添加到您将 POST 发送到的 URL。这通常适用于 POST 请求,即您可以发送 POST 以创建播放列表条目,并在您 POST 到的 URL 中包含 alt=json,并以 JSON 格式取回响应正文。如果它不适用于批量 POST 请求,我会感到惊讶。

于 2012-11-06T20:11:51.683 回答