Paul's Programming Notes     Archive     Feed     Github

Google Calendar Api bad request 400 - Python Authomatic Library

I was finally able to get the request to go through by adding a header saying it's json format. Here's an example:

requestbody = """
{
      "end": {
      "dateTime": "2014-05-18T01:35:00Z"
      },
      "start": {
      "dateTime": "2014-05-18T01:35:00Z"
      },
      "description": "test2",
      "location": "test venue",
      "summary": "test2"
      }
"""
response = authomatic.access(credentials, url, method='POST', headers={'Content-Type': 'application/json'}, body=requestbody)