View Source CurlReq.Plugin (CurlReq v0.98.4)

A collection of steps, usable with Req.

Examples

iex> Req.new(url: "https://catfact.ninja/fact")
...> |>CurlReq.Plugin.attach()

iex> Req.new(url: "https://catfact.ninja/fact")
...> |> CurlReq.Plugin.attach(log_level: :info, log_metadata: [ansi_color: :blue])

Possible improvements

This module could be improved. PRs are welcome!

  • [ ] configure redaction on a per-header basis

See also TeslaCurl for inspiration.

Summary

Functions

Attaches the plugin, main entry point for this module.

Req step: logs the request.

Types

@type option() :: {:log_level, Logger.level()} | {:log_metadata, any()}

Functions

Link to this function

attach(request, options \\ [])

View Source
@spec attach(Req.Request.t(), [option()]) :: Req.Request.t()

Attaches the plugin, main entry point for this module.

Req step: logs the request.