We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e7c4371 + f3d0c4c commit 9fbf221Copy full SHA for 9fbf221
lib/tesla/middleware.ex
@@ -14,6 +14,15 @@ defmodule Tesla.Middleware do
14
or inside tuple in case of dynamic middleware (`Tesla.client/1`):
15
16
Tesla.client([{Tesla.Middleware.BaseUrl, "https://example.com"}])
17
+
18
+ ## Ordering
19
20
+ The order in which middleware is defined matters. Note that the order when _sending_ the request
21
+ matches the order the middleware was defined in, but the order when _receiving_ the response
22
+ is reversed.
23
24
+ For example, `Tesla.Middleware.DecompressResponse` must come _after_ `Tesla.Middleware.JSON`,
25
+ otherwise the response isn't decompressed before it reaches the JSON parser.
26
27
## Writing custom middleware
28
0 commit comments