Versions in this module Expand all Collapse all v1 v1.0.3 May 3, 2020 v1.0.2 May 2, 2020 Changes in this version + const DefaultUserAgent + const MaxDuration + var DefaultClient = NewHTTPClient() + var ErrProxyAddrEmpty = errors.New("proxy addr is empty") + var ProxyAddr string + var UserAgent = DefaultUserAgent + func Fetch(method string, urlStr string, post interface{}, header map[string]string) (body []byte, err error) + func HTTPGet(urlStr string) (body []byte, err error) + func ParseCookieStr(cookieStr string) []*http.Cookie + func Req(method string, urlStr string, post interface{}, header map[string]string) (resp *http.Response, err error) + func SetGlobalProxy(proxyAddr string) + func SetLocalTCPAddrList(ips ...string) + func SetTCPHostBind(host, ip string) + type ContentLengther interface + ContentLength func() int64 + type ContentTyper interface + ContentType func() string + type Event func() + type EventOnError func(err error) + type HTTPClient struct + UserAgent string + func NewHTTPClient() *HTTPClient + func (h *HTTPClient) Fetch(method string, urlStr string, post interface{}, header map[string]string) (body []byte, err error) + func (h *HTTPClient) Req(method string, urlStr string, post interface{}, header map[string]string) (resp *http.Response, err error) + func (h *HTTPClient) ResetCookiejar() + func (h *HTTPClient) SetCookiejar(jar http.CookieJar) + func (h *HTTPClient) SetGzip(b bool) + func (h *HTTPClient) SetHTTPSecure(b bool) + func (h *HTTPClient) SetKeepAlive(b bool) + func (h *HTTPClient) SetProxy(proxyAddr string) + func (h *HTTPClient) SetResponseHeaderTimeout(t time.Duration) + func (h *HTTPClient) SetTLSHandshakeTimeout(t time.Duration) + func (h *HTTPClient) SetTimeout(t time.Duration) + func (h *HTTPClient) SetUserAgent(ua string)