如何调试Python Google API接口?
我正在尝试用谷歌日历API v3调试我的界面。我正在用python编写代码,并使用可以找到的API示例。我想确保我正在向API发送正确的html字符串。我看到代码是如何构建字符串和插入参数的,但我不知道在如何调试Python Google API接口?,python,google-api,google-api-python-client,Python,Google Api,Google Api Python Client,我正在尝试用谷歌日历API v3调试我的界面。我正在用python编写代码,并使用可以找到的API示例。我想确保我正在向API发送正确的html字符串。我看到代码是如何构建字符串和插入参数的,但我不知道在execute()命令中实际发送的字符串是什么 是否有一种方法可以打印正在发送而不是正在执行的html字符串?请举例说明 http = httplib2.Http(cache=".cache") http = credentials.authorize(http) service = buil
execute()
命令中实际发送的字符串是什么
是否有一种方法可以打印正在发送而不是正在执行的html字符串?请举例说明
http = httplib2.Http(cache=".cache")
http = credentials.authorize(http)
service = build("moderator", "v1", http=http)
series_body = {
"description": "Share and rank tips for eating healthy and cheap!",
"name": "Eating Healthy & Cheap",
"videoSubmissionAllowed": False
}
# How Do I print the string rather than execute?
series = service.series().insert(body=series_body).execute()
print "Created a new series"
您可以设置
httplib2.debuglevel=4
以打印stdout上的标题和请求/响应正文: