ExAcme.Request (ExAcme v0.3.0)

View Source

Provides functions to build and manage HTTP requests for the ACME API.

Summary

Types

The type of the request body.

t()

Request object

Functions

Builds a fetch request with the given URL.

Builds a named request by looking up the URL based on the given name and client.

Builds an update request with the given URL and body.

Looks up the URL associated with a given name from the client's directory.

Types

body()

@type body() :: String.t() | map()

The type of the request body.

t()

@type t() :: %ExAcme.Request{body: body(), url: String.t()}

Request object

Functions

build_fetch(url)

@spec build_fetch(String.t()) :: t()

Builds a fetch request with the given URL.

Parameters

  • url: The URL to fetch.

Returns

  • A request struct with the specified URL and an empty body.

build_named(name, body, client)

@spec build_named(String.t(), body(), ExAcme.client()) :: t()

Builds a named request by looking up the URL based on the given name and client.

Parameters

  • name: The name identifier for the request URL.
  • body: The content of the request body.
  • client: The client used to fetch the directory information.

Returns

  • A request struct with the looked-up URL and specified body.

build_update(url, body)

@spec build_update(String.t(), body()) :: t()

Builds an update request with the given URL and body.

Parameters

  • url: The URL to send the update to.
  • body: The content of the request body.

Returns

  • A request struct with the specified URL and body.

lookup_named_url(name, client)

@spec lookup_named_url(String.t(), ExAcme.client()) :: String.t()

Looks up the URL associated with a given name from the client's directory.

Parameters

  • name: The name identifier for the request URL.
  • client: The client used to fetch the directory information.

Returns

  • The URL associated with the given name in the directory.