Skip to content

Instantly share code, notes, and snippets.

@bulkan
Created December 21, 2010 04:58
Show Gist options
  • Save bulkan/749515 to your computer and use it in GitHub Desktop.
Save bulkan/749515 to your computer and use it in GitHub Desktop.
import httplib2
import json
h = httplib2.Http()
h.add_credentials('user1', 'user1')
json_str = json.dumps({'name':"joe blows"})
response, content = h.request("http://example.com/rest", method="POST", body=json_str, headers={'content-type':'application/json'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment