Skip to content

Instantly share code, notes, and snippets.

Jarrod nevros

View GitHub Profile
@logic
logic / methodreq.py
Created May 17, 2012
Adding an HTTP method to urllib2.Request.
View methodreq.py
import urllib2
class MethodRequest(urllib2.Request):
def __init__(self, *args, **kwargs):
if 'method' in kwargs:
self._method = kwargs['method']
del kwargs['method']
else:
self._method = None
return urllib2.Request.__init__(self, *args, **kwargs)
You can’t perform that action at this time.