如何从googleapi Youtube API获取XML响应 [英] How to get an XML response from the googleapi Youtube API
问题描述
我试图更新它们以使用新的API,但每次获得 JSON
结果时,而不是 XML
,旧的API返回了xml,所以我的代码需要一个xml返回结果。当我尝试在调用API时指定XML时,出现错误,表明调用无效。
任何人都可以向我解释如何检索XML来自YouTube API V3?
YouTube API v3 会以 JSon 的形式返回数据。无法将其更改为返回xml。
先决条件
- 向Google注册您的应用程序以便它可以提交API请求。
- 熟悉JSON(JavaScript
Object Notation)数据格式的核心概念。有关更多信息,
请参阅 json.org 。
It seems that YouTube has updated their API to a newer one (YouTube Data API (v3)), and suddenly the YouTube searches on my site are not working.
I am trying to update them to work with the new API, but every time I get a JSON
result, instead of XML
, the old API returned xml so my code expects a xml return result. When I tried to specify XML in the call to the API, I got an error that the call is invalid.
Can anyone please explain to me how I can retrieve an XML from the YouTube API V3?
The YouTube API v3 returns data in JSon. It is not possible to change it to return xml.
Prerequisites
- Register your application with Google so that it can submit API requests.
- Familiarize yourself with the core concepts of the JSON (JavaScript
Object Notation) data format. For more information, see json.org.
这篇关于如何从googleapi Youtube API获取XML响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!