Posts tagged urllib2

Using urllib2 to POST JSON

import json import urllib2 data = {‘name’:'Alex’,'colour’:'Green’,'number’:42,’foo’:'bar’} data = json.dumps(data) url = “http://somewebsite.zzz/webservice” req = urllib2.Request(url, data, {‘Content-Type’: ‘application/json’}) f = urllib2.urlopen(req) response = f.read() f.close() Excellent guide to Python and REST webservices: http://developer.yahoo.com/python/python-rest.html

Reducing admin with Python and http clients

One of my priorities at work is to reduce the offices administration overheads. Every employee has a talent and brings a skill set to the business. This experience is not used when humans are forced to waste their time logging into websites, filling in forms, formatting spreadsheets, downloading stats and doing things which can be [...]