Documentation ¶
Index ¶
- Constants
- type DialContext
- type HttpConfig
- func (config *HttpConfig) WithAllowRedirects(allowRedirects bool) *HttpConfig
- func (config *HttpConfig) WithDialContext(dial DialContext) *HttpConfig
- func (config *HttpConfig) WithHttpHandler(handler *httphandler.HttpHandler) *HttpConfig
- func (config *HttpConfig) WithHttpTransport(transport *http.Transport) *HttpConfig
- func (config *HttpConfig) WithIgnoreContentTypeForGetRequest(ignoreContentTypeForGetRequest bool) *HttpConfig
- func (config *HttpConfig) WithIgnoreSSLVerification(ignore bool) *HttpConfig
- func (config *HttpConfig) WithProxy(proxy *Proxy) *HttpConfig
- func (config *HttpConfig) WithRetries(retries int) *HttpConfig
- func (config *HttpConfig) WithSigningAlgorithm(signingAlgorithm algorithm.SigningAlgorithm) *HttpConfig
- func (config *HttpConfig) WithTimeout(timeout time.Duration) *HttpConfig
- type Proxy
Constants ¶
View Source
const ( DefaultTimeout = 120 * time.Second DefaultRetries = 0 DefaultIgnoreSSLVerification = false DefaultIgnoreContentTypeForGetRequest = false )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialContext ¶ added in v0.0.71
type HttpConfig ¶
type HttpConfig struct { DialContext DialContext Timeout time.Duration Retries int HttpProxy *Proxy IgnoreSSLVerification bool // AllowRedirects Experimental configuration, the default value is false. // Automatic redirection is allowed when turns on, which may cause some request exceptions. AllowRedirects bool HttpHandler *httphandler.HttpHandler // HttpTransport This configuration has the highest priority, // which means specifying the HttpTransport will invalidate other configurations, // such as DialContext, HttpProxy, IgnoreSSLVerification. HttpTransport *http.Transport // IgnoreContentTypeForGetRequest Ignore the request header Content-Type when sending a GET request, // the default value is false IgnoreContentTypeForGetRequest bool SigningAlgorithm algorithm.SigningAlgorithm }
func DefaultHttpConfig ¶
func DefaultHttpConfig() *HttpConfig
func (*HttpConfig) WithAllowRedirects ¶ added in v0.1.42
func (config *HttpConfig) WithAllowRedirects(allowRedirects bool) *HttpConfig
WithAllowRedirects Experimental configuration, the default value is false. Automatic redirection is allowed when turns on, which may cause some request exceptions.
func (*HttpConfig) WithDialContext ¶ added in v0.0.71
func (config *HttpConfig) WithDialContext(dial DialContext) *HttpConfig
func (*HttpConfig) WithHttpHandler ¶
func (config *HttpConfig) WithHttpHandler(handler *httphandler.HttpHandler) *HttpConfig
func (*HttpConfig) WithHttpTransport ¶ added in v0.1.43
func (config *HttpConfig) WithHttpTransport(transport *http.Transport) *HttpConfig
WithHttpTransport This configuration has the highest priority, which means specifying the HttpTransport will invalidate other configurations, such as DialContext, HttpProxy, IgnoreSSLVerification.
func (*HttpConfig) WithIgnoreContentTypeForGetRequest ¶ added in v0.1.52
func (config *HttpConfig) WithIgnoreContentTypeForGetRequest(ignoreContentTypeForGetRequest bool) *HttpConfig
WithIgnoreContentTypeForGetRequest Ignore the request header Content-Type when sending a GET request, the default value is false
func (*HttpConfig) WithIgnoreSSLVerification ¶
func (config *HttpConfig) WithIgnoreSSLVerification(ignore bool) *HttpConfig
func (*HttpConfig) WithProxy ¶
func (config *HttpConfig) WithProxy(proxy *Proxy) *HttpConfig
func (*HttpConfig) WithRetries ¶
func (config *HttpConfig) WithRetries(retries int) *HttpConfig
func (*HttpConfig) WithSigningAlgorithm ¶ added in v0.1.61
func (config *HttpConfig) WithSigningAlgorithm(signingAlgorithm algorithm.SigningAlgorithm) *HttpConfig
func (*HttpConfig) WithTimeout ¶
func (config *HttpConfig) WithTimeout(timeout time.Duration) *HttpConfig
type Proxy ¶
func (*Proxy) GetProxyUrl ¶
func (*Proxy) WithPassword ¶
func (*Proxy) WithSchema ¶
func (*Proxy) WithUsername ¶
Click to show internal directories.
Click to hide internal directories.