The new hook gives the user a place to modify requests on a per
attempt basis. This is required for protocols that include
one-time-use nonces such as OAuth 1.
- `Retry-After` header is preferred if present in the response
- HTTPClientMixin.DEFAULT_RETRY_TIMEOUT sets the default sleep time
- Sleep time can be set by the `retry_timeout` keyword arg
- Sleep time is exponentially increased with attempt count if the
`Retry-After` header is not present.
Only handle OSError and httpclient.HTTPError.
- We can assume any instance of httpclient.HTTPError is a failure
unrelated to the status code of the response. This is due to
sprockets.mixins.http setting `raise_error=False` when making the
request.
- ConnectionError and socket.gaierror are both instances of OSError
- CurlError is an instance of tornado.httpclient.HTTPError
- Other instances of tornado.httpclient.HTTPError include
HTTPTimeoutError and HTTPStreamClosedError
Also needed to fix the instance assertions in the test. It was always
true as it was evaluating the truthyness of a list - not the isinstance
values.
- Add ``history`` attribute of the response with all response objects
- Add ``links`` attribute of the response with the parsed link header if set
- Change logging level in a few places to a more appropriate level
- Add support for rejected consumers when auto-creating the ``User-Agent`` header
- Add the netloc of a request to the log entry created when rate limited
- Use RequestHandler.settings instead of RequestHandler.application.settings
when auto-creating the ``User-Agent`` header for a Tornado request handler
- Add test coverage of the Warning response header behavior