View Source ExUserCheck.HttpHelpers (ex_user_check v0.2.0)

Collection of helpers for HTTP requests

Summary

Functions

Performs an HTTP GET request with deserialization and error management.

HTTP options of req middleware

Functions

Link to this function

get(path, subpath, deserializer_fn, params \\ [])

View Source
@spec get(binary(), binary(), (map() -> any()), keyword()) ::
  {:ok, any()} | {:error, ExUserCheck.Error.t()}

Performs an HTTP GET request with deserialization and error management.

Parameters

  • path (binary): Base API path.
  • subpath (binary): API subpath.
  • deserializer_fn (function): Function to deserialize the response body.
  • params (keyword list, optional): Query parameters.

Returns

  • {:ok, deserialized_data} on success (200).
  • {:error, ExUserCheck.Error.t()} on failure.
Link to this function

req_options(path, subpath, params)

View Source
@spec req_options(binary(), binary(), keyword()) :: keyword()

HTTP options of req middleware