2012-11-05 141 views
0

我在一个批处理请求后的样子:返回JSON数据

<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批处理请求中如何?

+0

嗨,我有同样的麻烦。我想用JSON做出回应。你有没有找到任何方法? – eHussain

回答

0

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

+0

你的意思是链接,如http://gdata.youtube.com/feeds/api/videos/batch?alt=json但它不起作用 –