Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
common.Initializable
SetHeaders(headers ...common.Pair[string, string])
SetCookies(cookies ...*http.Cookie)
NewRequest(ctx context.Context, request *Request) (*http.Request, error)
Do(req *http.Request) (*http.Response, error)
Get(ctx context.Context, url string, opts ...RequestOption) (*http.Response, error)
PostJSON(ctx context.Context, url string, body any, opts ...RequestOption) (*http.Response, error)
}
type Option ¶
type Option func(*client)
func WithCert ¶
func WithCert(cert certutil.CertBundle, authType tls.ClientAuthType) Option
func WithLogger ¶
func WithTimeout ¶
type Request ¶
type RequestOption ¶
type RequestOption func(*Request)
func WithRequestCookies ¶
func WithRequestCookies(cookies ...*http.Cookie) RequestOption
func WithRequestHeaders ¶
func WithRequestHeaders(headers ...common.Pair[string, string]) RequestOption
Click to show internal directories.
Click to hide internal directories.