Cyphi.HttpAdapter behaviour (Cyphi v0.1.0)

Defines the behaviour for HTTP adapters used by Cyphi.Client.

This contract allows the HTTP backend to be swapped or mocked (e.g., using Req in production and a mock in tests). Implementing modules must handle the execution of the network request and return a standard Req.Response struct or an error tuple.

Summary

Callbacks

Contract for HTTP request adapters

Callbacks

send_request(method, url, opts)

@callback send_request(method :: atom(), url :: String.t(), opts :: keyword()) ::
  {:ok, Req.Response.t()} | {:error, term()}

Contract for HTTP request adapters