Public Member Functions | |
| def | __del__ |
| def | __init__ |
| def | close |
| def | fetch |
Private Attributes | |
| _async_client | |
| _closed | |
| _io_loop | |
A blocking HTTP client.
This interface is provided for convenience and testing; most applications
that are running an IOLoop will want to use `AsyncHTTPClient` instead.
Typical usage looks like this::
http_client = httpclient.HTTPClient()
try:
response = http_client.fetch("http://www.google.com/")
print response.body
except httpclient.HTTPError as e:
print "Error:", e
http_client.close()
Definition at line 54 of file httpclient.py.
| def tornado.httpclient.HTTPClient.__init__ | ( | self, | |
async_client_class = None, |
|||
| kwargs | |||
| ) |
Definition at line 69 of file httpclient.py.
| def tornado.httpclient.HTTPClient.__del__ | ( | self | ) |
Definition at line 76 of file httpclient.py.
| def tornado.httpclient.HTTPClient.close | ( | self | ) |
Closes the HTTPClient, freeing any resources used.
Definition at line 79 of file httpclient.py.
| def tornado.httpclient.HTTPClient.fetch | ( | self, | |
| request, | |||
| kwargs | |||
| ) |
Executes a request, returning an `HTTPResponse`. The request may be either a string URL or an `HTTPRequest` object. If it is a string, we construct an `HTTPRequest` using any additional kwargs: ``HTTPRequest(request, **kwargs)`` If an error occurs during the fetch, we raise an `HTTPError`.
Definition at line 86 of file httpclient.py.
Definition at line 69 of file httpclient.py.
tornado::httpclient.HTTPClient::_closed [private] |
Definition at line 69 of file httpclient.py.
tornado::httpclient.HTTPClient::_io_loop [private] |
Definition at line 69 of file httpclient.py.