How to get an XML response from the googleapi Youtube API

让人想犯罪 __ 提交于 2019-12-12 12:05:28

问题


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?


回答1:


The YouTube API v3 returns data in JSon. It is not possible to change it to return xml.

Prerequisites

  1. Register your application with Google so that it can submit API requests.
  2. Familiarize yourself with the core concepts of the JSON (JavaScript
    Object Notation) data format. For more information, see json.org.


来源:https://stackoverflow.com/questions/30153111/how-to-get-an-xml-response-from-the-googleapi-youtube-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!