2
我正嘗試使用Google Calendar API v3調試我的界面。我正在用python編寫我的代碼,並使用我可以找到的API示例。我想確保我將正確的html字符串發送到API。我看到代碼是如何構建字符串並插入參數的,但我不知道命令中發送的實際字符串是什麼。如何調試Python Google API接口?
有沒有辦法打印正在發送的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"