Documentation
¶
Index ¶
- func Delete(baseURL string, params *url.Values) (*models.Response, error)
- func Get(baseURL string, params *url.Values) (*models.Response, error)
- func GetTransport(enableHTTP2 bool) *http.Transport
- func IsHTTP2Enabled() bool
- func Patch(baseURL string, form *url.Values) (*models.Response, error)
- func Post(baseURL string, form *url.Values) (*models.Response, error)
- func Put(baseURL string, form *url.Values) (*models.Response, error)
- func PutTransport(transport *http.Transport)
- func SetHTTP2Enabled(enabled bool)
- type Client
- type Request
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTransport ¶ added in v0.0.2
func PutTransport ¶ added in v0.0.2
func SetHTTP2Enabled ¶
func SetHTTP2Enabled(enabled bool)
SetHTTP2Enabled 设置全局 HTTP/2 启用状态,并更新默认 Session
Types ¶
type Request ¶
type Request struct {
Method string
URL *neturl.URL
Headers http.Header
Body io.Reader
Params *customurl.Values
}
func NewRequest ¶
type Session ¶
type Session interface {
Client
WithBaseURL(base string) Session
WithTimeout(d time.Duration) Session
WithProxy(proxyURL string) Session
WithDNS(dnsServers []string) Session
WithHeader(key, value string) Session
WithHTTP2(enabled bool) Session
WithKeepAlive(enabled bool) Session
WithMaxIdleConns(maxIdle int) Session
Close() error
Clear() Session
}
Click to show internal directories.
Click to hide internal directories.