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) SetProxy(proxyFunc func(req *http.Request) (*url.URL, error))
- func (c *HTTPClient) SetTimeout(timeout time.Duration)
- type HTTPRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
func NewHTTPClient ¶
func NewHTTPClient() *HTTPClient
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) SetTimeout ¶ added in v1.0.8
func (c *HTTPClient) SetTimeout(timeout time.Duration)
Click to show internal directories.
Click to hide internal directories.