Documentation
¶
Index ¶
- func ToString(value interface{}) string
- type HttpClient
- func (h *HttpClient) AddHeader(name, value string)
- func (h *HttpClient) Close()
- func (h *HttpClient) DisableJA3()
- func (h *HttpClient) DoGet(path string) ([]byte, error)
- func (h *HttpClient) DoGetRaw(path string) ([]byte, error)
- func (h *HttpClient) DoPost(path string, postData map[string]string) ([]byte, error)
- func (h *HttpClient) DoPostAny(path string, postData interface{}) ([]byte, error)
- func (h *HttpClient) DoPostMultipart(path string, fields map[string]string) ([]byte, error)
- func (h *HttpClient) DoPostRaw(path, rawBody string) ([]byte, error)
- func (h *HttpClient) DoPut(path string, putData map[string]string) ([]byte, error)
- func (h *HttpClient) DoPutRaw(path string, raw []byte) ([]byte, error)
- func (h *HttpClient) DownloadFile(path, savePath string) error
- func (h *HttpClient) EnableJA3(profile string) error
- func (h *HttpClient) GetCookieValue(name string) string
- func (h *HttpClient) GetCookies() []*http.Cookie
- func (h *HttpClient) GetDomain() string
- func (h *HttpClient) GetHeader() map[string]string
- func (h *HttpClient) GetTimeout() time.Duration
- func (h *HttpClient) LogError(msg string, err error)
- func (h *HttpClient) LogInfo(msg string, fields ...interface{})
- func (h *HttpClient) SetCookies(cookies map[string]string, opts ...bool)
- func (h *HttpClient) SetDomain(domain string)
- func (h *HttpClient) SetHeader(headers map[string]string)
- func (h *HttpClient) SetLogger(logger *zap.SugaredLogger)
- func (h *HttpClient) SetProxy(cfg *ProxyConfig) error
- func (h *HttpClient) SetTimeout(timeout time.Duration)
- func (h *HttpClient) UploadFile(path, fieldName, filePath string, extraParams map[string]string) ([]byte, error)
- type ProxyConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(domain string, timeout ...time.Duration) *HttpClient
func (*HttpClient) AddHeader ¶ added in v1.0.13
func (h *HttpClient) AddHeader(name, value string)
func (*HttpClient) Close ¶ added in v1.0.8
func (h *HttpClient) Close()
func (*HttpClient) DisableJA3 ¶ added in v1.0.13
func (h *HttpClient) DisableJA3()
func (*HttpClient) DoGetRaw ¶ added in v1.0.19
func (h *HttpClient) DoGetRaw(path string) ([]byte, error)
func (*HttpClient) DoPostAny ¶ added in v1.0.6
func (h *HttpClient) DoPostAny(path string, postData interface{}) ([]byte, error)
func (*HttpClient) DoPostMultipart ¶ added in v1.0.19
func (*HttpClient) DoPostRaw ¶ added in v1.0.6
func (h *HttpClient) DoPostRaw(path, rawBody string) ([]byte, error)
func (*HttpClient) DoPutRaw ¶ added in v1.0.16
func (h *HttpClient) DoPutRaw(path string, raw []byte) ([]byte, error)
DoPutRaw 发送原始二进制数据(适用于 OSS 上传)
func (*HttpClient) DownloadFile ¶ added in v1.0.13
func (h *HttpClient) DownloadFile(path, savePath string) error
func (*HttpClient) EnableJA3 ¶ added in v1.0.11
func (h *HttpClient) EnableJA3(profile string) error
func (*HttpClient) GetCookieValue ¶ added in v1.0.13
func (h *HttpClient) GetCookieValue(name string) string
func (*HttpClient) GetCookies ¶
func (h *HttpClient) GetCookies() []*http.Cookie
func (*HttpClient) GetDomain ¶
func (h *HttpClient) GetDomain() string
func (*HttpClient) GetHeader ¶
func (h *HttpClient) GetHeader() map[string]string
func (*HttpClient) GetTimeout ¶ added in v1.0.4
func (h *HttpClient) GetTimeout() time.Duration
func (*HttpClient) LogError ¶ added in v1.0.1
func (h *HttpClient) LogError(msg string, err error)
func (*HttpClient) LogInfo ¶ added in v1.0.1
func (h *HttpClient) LogInfo(msg string, fields ...interface{})
func (*HttpClient) SetCookies ¶
func (h *HttpClient) SetCookies(cookies map[string]string, opts ...bool)
func (*HttpClient) SetDomain ¶
func (h *HttpClient) SetDomain(domain string)
func (*HttpClient) SetHeader ¶
func (h *HttpClient) SetHeader(headers map[string]string)
func (*HttpClient) SetLogger ¶ added in v1.0.1
func (h *HttpClient) SetLogger(logger *zap.SugaredLogger)
func (*HttpClient) SetProxy ¶
func (h *HttpClient) SetProxy(cfg *ProxyConfig) error
func (*HttpClient) SetTimeout ¶ added in v1.0.4
func (h *HttpClient) SetTimeout(timeout time.Duration)
func (*HttpClient) UploadFile ¶
Click to show internal directories.
Click to hide internal directories.