Documentation ¶
Index ¶
- func AppendUrlRandom(url string) string
- func GetCookieValueByCookesHeader(cookies, name string) string
- func NewGetRequest(url string) (*http.Request, error)
- func NewPostRequest(url string, body io.Reader) (*http.Request, error)
- func ReadRespBytes(resp *http.Response) (bytes []byte, err error)
- type HttpClient
- func (i *HttpClient) ClearCookie()
- func (i *HttpClient) Do(req *http.Request) (resp *http.Response, err error)
- func (i *HttpClient) GetBytes(url string) (bytes []byte, err error)
- func (i *HttpClient) GetCookie(url, name string) string
- func (i *HttpClient) GetCookies(url string) (cookies map[string]string, err error)
- func (i *HttpClient) GetCookiesString(url string) string
- func (i *HttpClient) GetResp(url string) (resp *http.Response, err error)
- func (i *HttpClient) GetString(url string) (str string, err error)
- func (i HttpClient) PostBytes(url string, data []byte) (bytes []byte, err error)
- func (i *HttpClient) PostResp(url string, data []byte) (resp *http.Response, err error)
- func (i *HttpClient) PostString(url, data string) (str string, err error)
- func (i *HttpClient) SetBodyTimeout(timeout int)
- func (i *HttpClient) SetCookie(url, name, value string) bool
- func (i *HttpClient) SetCookies(url, cookies string) bool
- func (i *HttpClient) SetCookiesByJson(url, data string) bool
- func (i *HttpClient) SetProxy(url string)
- func (i *HttpClient) SetReferer(referer string)
- func (i *HttpClient) SetResponseHeaderTimeout(timeout int)
- func (i *HttpClient) SetTimeout(timeout int)
- func (i *HttpClient) SetUserAgent(ua string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendUrlRandom ¶
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient() *HttpClient
func (*HttpClient) ClearCookie ¶
func (i *HttpClient) ClearCookie()
func (*HttpClient) GetCookie ¶
func (i *HttpClient) GetCookie(url, name string) string
func (*HttpClient) GetCookies ¶
func (i *HttpClient) GetCookies(url string) (cookies map[string]string, err error)
func (*HttpClient) GetCookiesString ¶
func (i *HttpClient) GetCookiesString(url string) string
func (*HttpClient) GetResp ¶
func (i *HttpClient) GetResp(url string) (resp *http.Response, err error)
func (HttpClient) PostBytes ¶
func (i HttpClient) PostBytes(url string, data []byte) (bytes []byte, err error)
func (*HttpClient) PostString ¶
func (i *HttpClient) PostString(url, data string) (str string, err error)
func (*HttpClient) SetBodyTimeout ¶
func (i *HttpClient) SetBodyTimeout(timeout int)
func (*HttpClient) SetCookie ¶
func (i *HttpClient) SetCookie(url, name, value string) bool
func (*HttpClient) SetCookies ¶
func (i *HttpClient) SetCookies(url, cookies string) bool
func (*HttpClient) SetCookiesByJson ¶
func (i *HttpClient) SetCookiesByJson(url, data string) bool
func (*HttpClient) SetProxy ¶
func (i *HttpClient) SetProxy(url string)
func (*HttpClient) SetReferer ¶
func (i *HttpClient) SetReferer(referer string)
func (*HttpClient) SetResponseHeaderTimeout ¶
func (i *HttpClient) SetResponseHeaderTimeout(timeout int)
func (*HttpClient) SetTimeout ¶
func (i *HttpClient) SetTimeout(timeout int)
func (*HttpClient) SetUserAgent ¶
func (i *HttpClient) SetUserAgent(ua string)
Click to show internal directories.
Click to hide internal directories.