Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Jun 19, 2024
1 parent 3d67b56 commit 425e69b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions lib/req.ex
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ defmodule Req do
* `:path_params` - if set, uses a templated request path (via
[`put_path_params`](`Req.Steps.put_path_params/1`) step.)
* `:path_params_style` - configures how `:path_params` are expressed (via
* `:path_params_style` (*available since v0.5.1*) - how path params are expressed (via
[`put_path_params`](`Req.Steps.put_path_params/1`) step). Can be one of:
* `:colon` - default, params are expressed as `:name` in the path.
* `:colon` - (default) for Plug-style parameters, such as `:code` in
`https://httpbin.org/status/:code`.
* `:curly` - uses [OpenAPI](https://swagger.io/specification/)-style `{name}` parameters.
*Available since v0.5.1*.
* `:curly` - for [OpenAPI](https://swagger.io/specification/)-style parameters, such as
`{code}` in `https://httpbin.org/status/{code}`.
Authentication options:
Expand Down
12 changes: 7 additions & 5 deletions lib/req/steps.ex
Original file line number Diff line number Diff line change
Expand Up @@ -414,17 +414,19 @@ defmodule Req.Steps do
* `:path_params_style` (*available since v0.5.1*) - how path params are expressed. Can be one of:
* `:colon` (default) for Plug-style parameters, such as `https://httpbin.org/status/:code`.
* `:colon` - (default) for Plug-style parameters, such as `:code` in
`https://httpbin.org/status/:code`.
* `:curly` for OpenAPI-style parameters, such as `https://httpbin.org/status/{code}`.
* `:curly` - for [OpenAPI](https://swagger.io/specification/)-style parameters, such as
`{code}` in `https://httpbin.org/status/{code}`.
## Examples
iex> Req.get!("https://httpbin.org/status/:code", path_params: [code: 200]).status
200
iex> Req.get!("https://httpbin.org/status/:code", path_params: [code: 201]).status
201
iex> Req.get!("https://httpbin.org/status/{code}", path_params: [code: 201], path_params_style: :curly).status
200
201
"""
@doc step: :request
Expand Down

0 comments on commit 425e69b

Please sign in to comment.