Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pratyay360/podman-ts/llms.txt
Use this file to discover all available pages before exploring further.
APIClient is the low-level HTTP client that sits beneath all resource managers. Normally you access it through client.api on a PodmanClient instance rather than constructing it directly. Use it when you need to call a Podman REST endpoint that the resource managers do not yet expose.
Constructor
Full URL to the Podman service. Supports
http+unix://, unix://, tcp://, and plain http:///https:// URLs.API version prefix used in every URL. Default:
"v5.0.0".Request timeout in milliseconds applied via
AbortSignal.timeout(). When omitted, no timeout is set.Maximum number of retry attempts on network-level errors. Uses exponential back-off starting at 100 ms, capped at 2 000 ms. Default:
0.URL construction
Every request URL is built as:- libpod (default): prefix is
libpod→/v5.0.0/libpod/containers/json - compat: prefix is
compat→/v5.0.0/compat/containers/json— setcompatible: trueinRequestConfig.
http+unix://…) are resolved automatically using Bun’s native unix fetch option.
HTTP methods
All methods accept apath (relative to the prefix) and an optional RequestConfig, and return Promise<APIResponse<T>>.
| Method | Signature |
|---|---|
get | get<T>(path: string, config?: RequestConfig): Promise<APIResponse<T>> |
post | post<T>(path: string, config?: RequestConfig): Promise<APIResponse<T>> |
put | put<T>(path: string, config?: RequestConfig): Promise<APIResponse<T>> |
patch | patch<T>(path: string, config?: RequestConfig): Promise<APIResponse<T>> |
delete | delete<T>(path: string, config?: RequestConfig): Promise<APIResponse<T>> |
head | head(path: string, config?: RequestConfig): Promise<APIResponse> |
options | options<T>(path: string, config?: RequestConfig): Promise<APIResponse<T>> |
RequestConfig
Passed as the second argument to any HTTP method.Query string parameters.
null and undefined values are dropped. Arrays are expanded to repeated keys.Additional HTTP headers to merge into the request.
Request body. Accepts plain objects (serialized to JSON), strings,
ArrayBuffer, Uint8Array, Blob, Buffer, and FormData. The Content-Type header is set automatically based on the type.When
true, uses the Docker-compat URL prefix (/compat) instead of the libpod prefix (/libpod). Default: false.Controls how the response body is read. When omitted, the client reads the
Content-Type response header and uses JSON for application/json, otherwise text.APIResponse<T>
Wraps the HTTP response returned by every request method.| Member | Type | Description |
|---|---|---|
status | number | HTTP status code. |
ok | boolean | true when status is 200–299. |
data | T | Parsed response body. |
raiseForStatus(NotFoundClass?) | void | Throws an APIError (or NotFound subclass) when status >= 400. Pass a custom NotFoundClass to override the error thrown for 404 responses. |
rawRequest
Response object without reading or parsing the body. Use this for attach, exec, or other streaming/hijacked connections where you need access to the raw ReadableStream.