Home | Trees | Indices | Help |
---|
|
object --+ | Client
A client handle a connection at a time. A client is threadsafe, but an handled shouldn't be shared between threads. All connections are shared between threads via a pool. >>> from restkit import * >>> c = Client() >>> r = c.request("http://google.com") r>>> r.status '301 Moved Permanently' >>> r.body_string() '<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>301 Moved</TITLE></HEAD><BODY> <H1>301 Moved</H1> The document has moved <A HREF="http://www.google.com/">here</A>. </BODY></HTML> ' >>> c.follow_redirect = True >>> r = c.request("http://google.com") >>> r.status '200 OK'
|
|||
response_class |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
version =
|
|
|||
Inherited from |
|
Client parameters ~~~~~~~~~~~~~~~~~ :param follow_redirect: follow redirection, by default False :param max_ollow_redirect: number of redirections available :filters: http filters to pass :param decompress: allows the client to decompress the response body :param max_status_line_garbage: defines the maximum number of ignorable lines before we expect a HTTP response's status line. With HTTP/1.1 persistent connections, the problem arises that broken scripts could return a wrong Content-Length (there are more bytes sent than specified). Unfortunately, in some cases, this cannot be detected after the bad response, but only before the next one. So the client is abble to skip bad lines using this limit. 0 disable garbage collection, None means unlimited number of tries. :param max_header_count: determines the maximum HTTP header count allowed. by default no limit. :param manager: the manager to use. By default we use the global one. :parama response_class: the response class to use :param timeout: the default timeout of the connection (SO_TIMEOUT) :param max_tries: the number of tries before we give up a connection :param wait_tries: number of time we wait between each tries. :param ssl_args: named argument, see ssl module for more informations
|
Populate filters from self.filters. Must be called each time self.filters is updated. |
perform the request. If an error happen it will first try to restart it |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Sep 19 18:07:08 2011 | http://epydoc.sourceforge.net |