Public Member Functions | |
| def | __del__ |
| def | __init__ |
| def | close |
| def | fetch |
Private Attributes | |
| _async_client | |
| _closed | |
| _io_loop | |
| _response | |
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, e:
print "Error:", e
Definition at line 46 of file httpclient.py.
| def tornado.httpclient.HTTPClient.__init__ | ( | self, | |
async_client_class = None, |
|||
| kwargs | |||
| ) |
Definition at line 60 of file httpclient.py.
| def tornado.httpclient.HTTPClient.__del__ | ( | self | ) |
Definition at line 68 of file httpclient.py.
| def tornado.httpclient.HTTPClient.close | ( | self | ) |
Closes the HTTPClient, freeing any resources used.
Definition at line 71 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 78 of file httpclient.py.
Definition at line 60 of file httpclient.py.
tornado::httpclient.HTTPClient::_closed [private] |
Definition at line 60 of file httpclient.py.
tornado::httpclient.HTTPClient::_io_loop [private] |
Definition at line 60 of file httpclient.py.
Definition at line 60 of file httpclient.py.