A Declarative HTTP Client for Python
uplink.retry.RetryBackoff
, which can be extended to
implement custom backoff strategies. An instance of a RetryBackoff
subclass
can be provided through the backoff
argument of the @retry
decorator.
(#238)six
to 1.13.0
. (#246)@returns.json
to cast JSON response (or field referenced by the key
argument) using the type
argument when the given type is callable. This
restores behavior that was inadvertently changed in v0.9.3. (#215)asyncio.coroutine
in the library code to fix warnings
related to the function's deprecation in Python 3.8+. (#203)Context
argument annotation to pass request-specific information to
middleware. (#143, #155)Session.context
property to pass session-specific information to
middleware. (#143, #155)@returns.*
decorators should override the
consumer method's return annotation. (#144, #154)@returns.*
decorators should propagate to all consumer method when used
as a class decorator. (#145, #154)Consumer
subclass no longer affects other subclasses. (#152)uplink.retry.stop.DISABLE
to uplink.retry.stop.NEVER
retry
decorator to enable reattempts of failed requests. (#132)ratelimit
decorator to constrain consumers to making some maximum number
of calls within a given time period. (#132)Timeout
argument annotation to be able to pass the timeout as a consumer
method argument or to inject it as a transaction hook using a Consumer
instance's _inject
method. (#133 by @daa)Consumer
subclasses now inherit class decorators from their
Consumer
parents, so those decorators are also applied to the subclasses'
methods that are decorated with @get
, @post
, @patch
, etc.
(#138 by @daa)RequestsClient
and AiohttpClient
caused by
use of atexit.register
, which was holding references to session objects
and preventing the garbage collector from freeing memory reserved for those
objects. (#134 by @SakornW)Consumer.exceptions
property for handling common client exceptions in a client-agnostic way. (#117)requires_consumer
for response_handler
and error_handler
; when set to True
, the registered callback should accept a reference to a Consumer
instance as its leading argument. (#118)Query
-annotated argument, a None
value indicates that the query parameter should be excluded from the request. Previous behavior was to encode the parameter as ...?name=None
. To retain this behavior, specify the new encode_none
parameter (i.e., Query(..., encode_none="None")
). (#126 by @nphilipp)Schema().load
and Schema().dump
in marshmallow
v3. (#109)