Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Mar 17, 2024
1 parent 6bc8316 commit 8fbd236
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions lib/req.ex
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ defmodule Req do
* `:plug` - if set, calls the given plug instead of making an HTTP request over the network (via [`run_plug`](`Req.Steps.run_plug/1`) step).
The plug can be one of:
* `fun(conn)` - a function plug.
* `module` or `{module, options}` - a module plug.
Finch options ([`run_finch`](`Req.Steps.run_finch/1`) step)
* `:finch` - the Finch pool to use. Defaults to pool automatically started by `Req`.
Expand Down
6 changes: 5 additions & 1 deletion lib/req/steps.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,11 @@ defmodule Req.Steps do
## Request Options
* `:plug` - the plug to run the request against.
* `:plug` - the plug to run the request against. The plug can be one of:
* `fun(conn)` - a 1-arity function that accepts a `Plug.Conn` and returns it.
* `module` or `{module, options}` - a module plug
## Examples
Expand Down
7 changes: 5 additions & 2 deletions lib/req/test.ex
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,11 @@ defmodule Req.Test do
See [module documentation](`Req.Test`) for more examples.
While this function can store any `value` under `stub_name`, usually you'll want to store
a *plug*, that is, a function that takes a `Plug.Conn` and returns a `Plug.Conn`, a module plug,
or a `{module, options}` plug.
a *plug*, that is:
* `fun(conn)` - a function plug.
* `module` or `{module, options}` - a module plug.
## Examples
Expand Down

0 comments on commit 8fbd236

Please sign in to comment.