我目前正在使用apiclient
Google API 库。特别是蟒蛇。文档真的不清楚。我不知道如何利用request_id
从回调中获得的信息。我的意思是这段代码:
from apiclient.http import BatchHttpRequest
def insert_animal(request_id, response, exception):
if exception is not None:
# Do something with the exception
pass
else:
# Do something with the response
pass
service = build('farm', 'v2')
batch = service.new_batch_http_request(callback=insert_animal)
batch.add(service.animals().insert(name="sheep"))
batch.add(service.animals().insert(name="pig"))
batch.add(service.animals().insert(name="llama"))
batch.execute(http=http)
谁能解释一下request_id
?我可以自定义值吗?