client

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient struct {
	// contains filtered or unexported fields
}

HTTPClient wraps http.Client with custom configuration

func New

func New(baseURL string) *HTTPClient

New creates a new HTTP client

func (*HTTPClient) CheckServer

func (c *HTTPClient) CheckServer(ctx context.Context) error

CheckServer verifies the server is reachable

func (*HTTPClient) MakeRequest

func (c *HTTPClient) MakeRequest(
	ctx context.Context,
	method, endpoint string,
	headers map[string]string,
	body map[string]any,
) (int, []byte, http.Header, error)

MakeRequest executes an HTTP request and returns the status code, response body, and response headers

func (*HTTPClient) MakeRequestWithFile

func (c *HTTPClient) MakeRequestWithFile(
	ctx context.Context,
	method, endpoint string,
	headers map[string]string,
	filePath, fieldName string,
) (int, []byte, http.Header, error)

MakeRequestWithFile executes an HTTP request with a file upload

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL