Changes

1.3

  • Detection of file size & type if body object is a file object. Also fix Content-Length for strings
  • Code have been refactored. All exceptions are now in restclient.errors. All transports have been splitted in restclient.transport
  • curl transport default timeout is now 0.
  • some fixes

1.2

Encoding:

  • unicode urls are now managed
  • data get from response is now in unicode if it’s not a binary

Fixes:

  • curl client have been fixed
  • new response object that act now as a real dict. You could get all headers of the response like this :
>>> from restclient import Resource
>>> res = Resource('http://e-engura.org')
>>> page = res.get()
>>> res.status
200
>>> res.response
<HTTPResponse status 200 for http://e-engura.org>
>>> res.response.__dict__
{'status': 200, 'final_url': 'http://e-engura.org'}
>>> for i in res.response.items():
...     print i
...
('status', 200)
('content-length', '5448')
('final_url', 'http://e-engura.org')
('accept-ranges', 'bytes')
('server', 'nginx/0.6.31')
('last-modified', 'Sun, 28 Dec 2008 23:15:27 GMT')
('connection', 'keep-alive')
('date', 'Wed, 04 Feb 2009 21:52:14 GMT')
('content-type', 'text/html')

See also

Resource

Table Of Contents

Previous topic

Console client

Next topic

Resource

This Page

Quick search