Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithRedirectCallback ¶ added in v0.15.0
func WithRedirectCallback(ctx context.Context, cb RedirectCallback) context.Context
WithRedirectCallback returns a context with a redirect callback.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a wrapped HTTP client.
func NewClient ¶
func NewClient(cfg ClientConfig) *Client
NewClient returns an initialized Client given the provided configuration.
func (*Client) NewRequest ¶
NewRequest returns an *http.Request given the provided configuration.
type ClientConfig ¶
type ClientConfig struct {
CACerts []*x509.Certificate
ClientCert *tls.Certificate
DNSServer *url.URL
HTTP core.HTTPVersion
Insecure bool
Proxy *url.URL
Redirects *int
TLS uint16
UnixSocket string
}
ClientConfig represents the optional configuration parameters for a Client.
type RedirectCallback ¶ added in v0.15.0
type RedirectCallback func(hop RedirectHop)
RedirectCallback is called when a redirect occurs.
type RedirectHop ¶ added in v0.15.0
type RedirectHop struct {
Request *http.Request // The request that triggered the redirect
Response *http.Response // The redirect response (e.g., 302)
NextRequest *http.Request // The new request about to be made
}
RedirectHop represents a single redirect in the chain.
type RequestConfig ¶
type RequestConfig struct {
AWSSigV4 *aws.Config
Basic *core.KeyVal[string]
Bearer string
ContentType string
Data io.Reader
Form []core.KeyVal[string]
Headers []core.KeyVal[string]
HTTP core.HTTPVersion
Method string
Multipart *multipart.Multipart
NoEncode bool
QueryParams []core.KeyVal[string]
Range []string
URL *url.URL
}
RequestConfig represents the configuration for creating an HTTP request.
Click to show internal directories.
Click to hide internal directories.