willingc

Untitled

Apr 30th, 2014
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. def run_post():
  2. url = 'http://httpbin.org/post'
  3. data = {'a': 10, 'b': [{'c': True, 'd': False}, None]}
  4. headers = {'Content-Type': 'application/json'}
  5.  
  6. r = requests.post(url, data=json.dumps(data), headers=headers)
  7.  
  8. return json.dumps(r.json(), indent=4)
Advertisement
Add Comment
Please, Sign In to add comment