我正在尝试使用文档中所述的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的示例。
如何为发现Calendar API V3生成或获取响应json?