View Source Chalk.Client.Request (chalk_elixir v0.0.12)

Data structure for an HTTP request with convenience functions.

Link to this section Summary

Functions

Add telemetry metadata to Request. Calling without the second argument adds default metadata. Custom metadata is added by passing a map with a key telemetry_metadata. Example

Convert Request to options format passed to Tesla.request/2.

Link to this section Types

@type t() :: %Chalk.Client.Request{
  body: map(),
  endpoint: String.t(),
  method: atom(),
  opts: map()
}

Link to this section Functions

Link to this function

add_metadata(request, config \\ %{})

View Source
@spec add_metadata(t(), map()) :: t()

Add telemetry metadata to Request. Calling without the second argument adds default metadata. Custom metadata is added by passing a map with a key telemetry_metadata. Example

Request.add_metadata(request, %{telemetry_metadata: %{k: v}})
@spec to_options(t()) :: keyword()

Convert Request to options format passed to Tesla.request/2.