HomePhorge
Diffusion tesla bd7c708f6060

Introduce Tesla.Client with pre/post middleware

Description

Introduce Tesla.Client with pre/post middleware

This change is backward compatible:

  • Tesla.build_client API stays the same
  • one can still use simple function as a client

Tesla.Client struct can hold any custom fun (as before)
but can now hold pre and post middleware lists.
pre works the same way as one given to build_client.
post middleware is injected right before adapter.
It can be used as a regular middleware but can be also
used to dynamically override adapter in runtime.
This is mostly useful in testing

Details

Provenance
Tymon TobolskiAuthored on Sep 11 2017, 6:44 AM
Parents
R28:7a77b0463035: Introduce Tesla.Middleware.Opts
Branches
Unknown
Tags
Unknown

Event Timeline