Documentation
¶
Index ¶
- type HTTPClient
- func (c *HTTPClient) ExecuteRequest(r *HTTPRequest) (*http.Response, error)
- func (c *HTTPClient) GetResponseData(r *HTTPRequest) ([]byte, error)
- func (c *HTTPClient) SaveResponseToFile(r *HTTPRequest, filepath string) error
- func (c *HTTPClient) SetInsecureSkipVerify(skip bool)
- func (c *HTTPClient) SetLogger(logger *log.Logger)
- func (c *HTTPClient) SetProxy(proxyURL string) error
- func (c *HTTPClient) SetTimeout(timeout time.Duration)
- func (c *HTTPClient) SetTransport(transport *http.Transport)
- type HTTPRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
HTTPClient HTTP客户端封装
func (*HTTPClient) ExecuteRequest ¶ added in v1.0.9
func (c *HTTPClient) ExecuteRequest(r *HTTPRequest) (*http.Response, error)
ExecuteRequest 执行HTTP请求
func (*HTTPClient) GetResponseData ¶ added in v1.0.9
func (c *HTTPClient) GetResponseData(r *HTTPRequest) ([]byte, error)
GetResponseData 发送HTTP请求并返回响应数据
func (*HTTPClient) SaveResponseToFile ¶ added in v1.0.9
func (c *HTTPClient) SaveResponseToFile(r *HTTPRequest, filepath string) error
SaveResponseToFile 发送HTTP请求并将响应保存到文件
func (*HTTPClient) SetInsecureSkipVerify ¶ added in v1.1.0
func (c *HTTPClient) SetInsecureSkipVerify(skip bool)
SetInsecureSkipVerify 设置跳过TLS证书验证
func (*HTTPClient) SetLogger ¶ added in v1.1.0
func (c *HTTPClient) SetLogger(logger *log.Logger)
SetLogger 设置自定义日志器
func (*HTTPClient) SetProxy ¶ added in v1.0.8
func (c *HTTPClient) SetProxy(proxyURL string) error
SetProxy 设置代理
func (*HTTPClient) SetTimeout ¶ added in v1.0.8
func (c *HTTPClient) SetTimeout(timeout time.Duration)
SetTimeout 设置超时时间
func (*HTTPClient) SetTransport ¶ added in v1.1.0
func (c *HTTPClient) SetTransport(transport *http.Transport)
SetTransport 设置自定义传输层
Click to show internal directories.
Click to hide internal directories.