2

I am trying to debug my interface with Google Calendar API v3. I am writing my code in python and using the API examples I can find. I want to make sure that I am sending the correct html string to the API. I see how the code is building the string and inserting parameters, but I don't know what the actual string is getting sent in the execute() command.

Is there a way to print the html string that is getting sent rather than executing? Examples please.

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"
4

1 回答 1

1

您可以设置httplib2.debuglevel = 4在标准输出上打印标题和请求/响应正文:

http://code.google.com/p/google-api-python-client/wiki/Debugging

于 2012-05-22T03:27:16.597 回答