Allow PATCH to list of valid HTTP methods
This commit is contained in:
parent
8d3da20302
commit
dfad7c64fb
1 changed files with 1 additions and 1 deletions
|
@ -669,7 +669,7 @@ def open_url(url, data=None, headers=None, method=None, use_proxy=True,
|
||||||
urllib2.install_opener(opener)
|
urllib2.install_opener(opener)
|
||||||
|
|
||||||
if method:
|
if method:
|
||||||
if method.upper() not in ('OPTIONS','GET','HEAD','POST','PUT','DELETE','TRACE','CONNECT'):
|
if method.upper() not in ('OPTIONS','GET','HEAD','POST','PUT','DELETE','TRACE','CONNECT','PATCH'):
|
||||||
raise ConnectionError('invalid HTTP request method; %s' % method.upper())
|
raise ConnectionError('invalid HTTP request method; %s' % method.upper())
|
||||||
request = RequestWithMethod(url, method.upper(), data)
|
request = RequestWithMethod(url, method.upper(), data)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue