Skip to content

Commit 64d9c63

Browse files
committed
Update docs for simple_httpclient.
1 parent b8500d3 commit 64d9c63

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

tornado/simple_httpclient.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,28 @@
3030
class SimpleAsyncHTTPClient(object):
3131
"""Non-blocking HTTP client with no external dependencies.
3232
33-
WARNING: This class is still in development and not yet recommended
34-
for production use.
35-
3633
This class implements an HTTP 1.1 client on top of Tornado's IOStreams.
3734
It does not currently implement all applicable parts of the HTTP
3835
specification, but it does enough to work with major web service APIs
3936
(mostly tested against the Twitter API so far).
4037
41-
Many features found in the curl-based AsyncHTTPClient are not yet
42-
implemented. The currently-supported set of parameters to HTTPRequest
43-
are url, method, headers, body, streaming_callback, and header_callback.
44-
Connections are not reused, and no attempt is made to limit the number
45-
of outstanding requests.
38+
This class has not been tested extensively in production and
39+
should be considered somewhat experimental as of the release of
40+
tornado 1.2. It is intended to become the default AsyncHTTPClient
41+
implementation in a future release. It may either be used
42+
directly, or to facilitate testing of this class with an existing
43+
application, setting the environment variable
44+
USE_SIMPLE_HTTPCLIENT=1 will cause this class to transparently
45+
replace tornado.httpclient.AsyncHTTPClient.
46+
47+
Some features found in the curl-based AsyncHTTPClient are not yet
48+
supported. In particular, proxies are not supported, connections
49+
are not reused, and callers cannot select the network interface to be
50+
used.
4651
4752
Python 2.6 or higher is required for HTTPS support. Users of Python 2.5
4853
should use the curl-based AsyncHTTPClient if HTTPS support is required.
54+
4955
"""
5056
_ASYNC_CLIENTS = weakref.WeakKeyDictionary()
5157

@@ -190,9 +196,11 @@ def _on_connect(self, parsed):
190196
if (self.request.method not in self._SUPPORTED_METHODS and
191197
not self.request.allow_nonstandard_methods):
192198
raise KeyError("unknown method %s" % self.request.method)
193-
if self.request.network_interface:
194-
raise NotImplementedError(
195-
"network interface selection not supported")
199+
for key in ('network_interface',
200+
'proxy_host', 'proxy_port',
201+
'proxy_username', 'proxy_password'):
202+
if getattr(self.request, key, None):
203+
raise NotImplementedError('%s not supported' % key)
196204
if "Host" not in self.request.headers:
197205
self.request.headers["Host"] = parsed.netloc
198206
if self.request.auth_username:

0 commit comments

Comments
 (0)