Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- https://stackoverflow.com/a/9746432/496445
- """
- import json
- import urllib.request
- data = {
- 'ids': [12, 3, 4, 5, 6]
- }
- req = urllib.request.Request('http://example.com/api/posts/create')
- req.add_header('Content-Type', 'application/json')
- response = urllib.request.urlopen(req, json.dumps(data).encode('utf8'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement