Skip to content

Instantly share code, notes, and snippets.

@pawl
Created June 2, 2014 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawl/7017f7ef477bde8e9bdc to your computer and use it in GitHub Desktop.
Save pawl/7017f7ef477bde8e9bdc to your computer and use it in GitHub Desktop.
Escape Newlines In Google Calendar API - Python
# how you need to format the body of the request
requestbody = """{
"description": %s,
"summary": %s
}
""" % (json.dumps(description), json.dumps(summary)) # use json.dumps to escape string for the request body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment