Message21178
If a server returns a code other than 200, specifically 201
(Created), urllib2.urlopen will raise an HTTPError exception. I ran
into this while implementing an Atom API client, which solicits 201
responses from the server when submitting a blog post.
File "/usr/local/lib/python2.3/urllib2.py", line 129, in urlopen
return _opener.open(url, data)
File "/usr/local/lib/python2.3/urllib2.py", line 326, in open
'_open', req)
File "/usr/local/lib/python2.3/urllib2.py", line 306, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.3/urllib2.py", line 901, in http_open
return self.do_open(httplib.HTTP, req)
File "/usr/local/lib/python2.3/urllib2.py", line 895, in do_open
return self.parent.error('http', req, fp, code, msg, hdrs)
File "/usr/local/lib/python2.3/urllib2.py", line 352, in error
return self._call_chain(*args)
File "/usr/local/lib/python2.3/urllib2.py", line 306, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.3/urllib2.py", line 412, in
http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 201: Created
|
|
Date |
User |
Action |
Args |
2007-08-23 14:22:33 | admin | link | issue971965 messages |
2007-08-23 14:22:33 | admin | create | |
|