Caddy.Admin.Request (Caddy v2.3.1)
View SourceLow-level HTTP client for Caddy Admin API.
This module provides direct HTTP communication with the Caddy admin API using either Unix domain sockets or TCP connections. It implements the RequestBehaviour and handles GET, POST, PUT, PATCH, and DELETE operations.
Implementation Details
- Uses
Caddy.Admin.Transportfor connection management - Supports both Unix sockets (embedded mode) and TCP (external mode)
- Parses HTTP responses with
:http_binpacket mode - Automatically decodes JSON responses
- Returns structured response with status, headers, and body
Summary
Functions
Send HTTP DELETE method to admin API
Send HTTP GET method to admin API
Send HTTP PATCH method to admin API
Send HTTP POST method to admin API
Send HTTP PUT method to admin API
Types
Functions
@spec delete(binary(), binary(), binary()) :: {:ok, atom() | %{:headers => list(), optional(any()) => any()}, String.t() | map()}
Send HTTP DELETE method to admin API
Send HTTP GET method to admin API
Send HTTP PATCH method to admin API
Send HTTP POST method to admin API
@spec put(binary(), binary(), binary()) :: {:ok, atom() | %{:headers => list(), optional(any()) => any()}, String.t() | map()}
Send HTTP PUT method to admin API