Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何调试Python Google API接口?_Python_Google Api_Google Api Python Client - Fatal编程技术网

如何调试Python Google API接口?

如何调试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

我正在尝试用谷歌日历API v3调试我的界面。我正在用python编写代码,并使用可以找到的API示例。我想确保我正在向API发送正确的html字符串。我看到代码是如何构建字符串和插入参数的,但我不知道在
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上的标题和请求/响应正文: