【问题标题】:Getting the response discovery json for the client mocker获取客户端模拟程序的响应发现 json
【发布时间】:2017-07-16 11:40:48
【问题描述】:

我正在尝试使用以下文档中描述的 Google API 模拟程序。但是对于 Calendar API,而不是 Book API。

from apiclient.discovery import build
from apiclient.http import HttpMock
import pprint

http = HttpMock('books-discovery.json', {'status': '200'})
api_key = 'your_api_key'
service = build('books', 'v1', http=http, developerKey=api_key)
request = service.volumes().list(source='public', q='android')
http = HttpMock('books-android.json', {'status': '200'})
response = request.execute(http=http)
pprint.pprint(response)

有一个图书发现json返回值here的例子。

如何为发现日历 API V3 生成或获取响应 json?

【问题讨论】:

    标签: python python-2.7 google-api-python-client


    【解决方案1】:

    您可以使用API Discovery Service 获取日历 API v3 的发现文档。

    【讨论】:

    • 讽刺。几个小时前,我自己确实发现了这一点,但还没有机会回答我自己的问题。 +1 并被接受。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-11
    • 2023-03-03
    • 2019-05-18
    • 2016-04-10
    • 2015-11-29
    • 1970-01-01
    • 2019-08-05
    相关资源
    最近更新 更多