client

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	Cert       string
	Key        string
	PFX        string
	Passphrase string
}

Certificate holds TLS certificate configuration

type ClientConfig

type ClientConfig struct {
	Timeout         time.Duration
	FollowRedirects bool
	InsecureSSL     bool
	Proxy           string
	ExcludeProxy    []string
	RememberCookies bool
	DefaultHeaders  map[string]string
	Certificates    map[string]Certificate
}

ClientConfig holds client configuration

func DefaultConfig

func DefaultConfig() *ClientConfig

DefaultConfig returns a default client configuration

type HttpClient

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

HttpClient is an HTTP client with auth support

func NewHttpClient

func NewHttpClient(config *ClientConfig) (*HttpClient, error)

NewHttpClient creates a new HTTP client

func (*HttpClient) ClearCookies

func (c *HttpClient) ClearCookies()

ClearCookies clears all stored cookies

func (*HttpClient) Send

func (c *HttpClient) Send(request *models.HttpRequest) (*models.HttpResponse, error)

Send sends an HTTP request and returns the response

func (*HttpClient) SendWithContext

func (c *HttpClient) SendWithContext(ctx context.Context, request *models.HttpRequest) (*models.HttpResponse, error)

SendWithContext sends an HTTP request with context

Jump to

Keyboard shortcuts

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