HookSniff.Client (hooksniff v1.2.0)

HTTP client for making requests to the HookSniff API. Uses HTTPoison with retry logic and error handling.

Summary

Functions

Make an HTTP request to the HookSniff API.

Make a request and return only the body, raising on error.

Functions

request(method, path, body \\ nil, client)

@spec request(atom(), String.t(), map() | nil, HookSniff.t()) ::
  {:ok, %{status: integer(), body: term()}} | {:error, term()}

Make an HTTP request to the HookSniff API.

Parameters

  • method — HTTP method atom (:get, :post, :put, :delete)
  • path — API path (e.g., /v1/endpoints)
  • body — Optional request body (will be JSON-encoded)
  • client%HookSniff{} struct with connection info

Returns

  • {:ok, %{status: integer, body: term}} on success
  • {:error, reason} on failure

request!(method, path, body \\ nil, client)

@spec request!(atom(), String.t(), map() | nil, HookSniff.t()) :: term()

Make a request and return only the body, raising on error.