Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// Get sends an HTTP GET request to the specified URL with optional headers.
Get(ctx context.Context, url string, headers ReqHeader) (*http.Response, error)
// Post sends an HTTP POST request with a JSON-serializable body and optional headers.
Post(ctx context.Context, url string, reqBody any, headers ReqHeader) (*http.Response, error)
// Put sends an HTTP PUT request with a JSON-serializable body and optional headers.
Put(ctx context.Context, url string, reqBody any, headers ReqHeader) (*http.Response, error)
// Put sends an HTTP PUT request with a JSON-serializable body and optional headers.
Patch(ctx context.Context, url string, reqBody any, headers ReqHeader) (*http.Response, error)
// Delete sends an HTTP DELETE request to the specified URL with optional JSON body and headers.
Delete(ctx context.Context, url string, reqBody any, headers ReqHeader) (*http.Response, error)
}
Client defines a simple HTTP client interface for making RESTful requests with optional headers and JSON payloads.
Click to show internal directories.
Click to hide internal directories.