Commit graph

20 commits

Author SHA1 Message Date
Dave Shawley
31daef908d Add Travis CI control file. 2016-02-28 09:00:31 -05:00
Dave Shawley
0c972ce6c2 Polish the documentation a little. 2016-02-28 09:00:15 -05:00
Dave Shawley
b8843a425a Export HTTPClient and HTTPError in the top-level module. 2016-02-28 08:59:57 -05:00
Dave Shawley
9bbee48f09 HTTPClient: Return a future from send_request.
This makes it possible to do something more interesting than simply
yielding.  You can yield client.send_request() and it will work just as
you expect it to or you can add callbacks to the returned future and
process it yourself.
2016-02-28 08:44:16 -05:00
Dave Shawley
1773131fb6 HTTPClient: Add headers property. 2016-02-28 08:44:16 -05:00
Dave Shawley
056f20a066 ClientMixin: Expose client instance as http_client. 2016-02-28 08:44:16 -05:00
Dave Shawley
2e657ab0f5 HTTPClient: Delay AsyncHTTPClient creation.
The AsyncHTTPClient initializer grabs a handle on the active IOLoop
which causes problems if you create a client before you start the IOLoop
and you are running in multi-process mode.  This is easy enough to fix
in this case, so I'll delay grabbing a client until I actually need one.
2016-02-28 08:44:12 -05:00
Dave Shawley
eb037af4dd test: Move local httpbin configuration. 2016-02-25 07:34:14 -05:00
Dave Shawley
1203bd449d Split "server" parameter into "scheme", "host", and "port". 2016-02-24 08:00:39 -05:00
Dave Shawley
26621eca3a client.HTTPError: Add to_server_error method. 2016-01-31 10:32:00 -05:00
Dave Shawley
25d0b7e99c Move error and request handling into HTTPClient. 2016-01-31 10:23:04 -05:00
Dave Shawley
fe33ae9f3b tests: Enable local httpbin server for testing. 2016-01-31 09:26:07 -05:00
Dave Shawley
fa51514627 Introduce HTTPClient. 2016-01-10 10:11:13 -05:00
Dave Shawley
7d41dbfb8c ClientMixin: Make method a required parameter. 2016-01-10 09:42:32 -05:00
Dave Shawley
37e4ae2fd1 ClientMixin: Translate API request timeouts to 503. 2016-01-08 08:05:20 -05:00
Dave Shawley
ba9063cff0 ClientMixin: Make invalid status codes safe again. 2016-01-08 08:04:39 -05:00
Dave Shawley
f80f3dd16c ClientMixin: Fix strange infinite recursion bug.
When running the LoggingTests on pypy3 (PyPy 2.4.0), both the server and
client error tests result in infinite recursion in
tornado.httpclient.HTTPResponse.__repr__ when logging the error with a
%r.  The initializer for the response creates a HTTPError object with a
referential loop:

    def __init__(self, ... error=None):
    	# ....
        if error is None:
	    self.error = HTTPError(self.code, message=self.reason,
	                           response=self)

When printing a HTTPError with %r it prints to response object's repr
which in turn prints the error's repr.
2016-01-08 07:27:40 -05:00
Dave Shawley
d887ae41b7 ClientMixin: Don't overwrite existing self.logger. 2016-01-08 07:27:32 -05:00
Dave Shawley
0c36a1a917 Initial implementation of ClientMixin. 2016-01-07 19:59:55 -05:00
Dave Shawley
75e630b20c SYN 2016-01-07 19:58:39 -05:00