v0.0.0-...-04a33bb Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2021 License: GPL-3.0 Imports: 15 Imported by: 6




This section is empty.


This section is empty.


func AppendUrlRandom

func AppendUrlRandom(url string) string

func GetCookieValueByCookesHeader

func GetCookieValueByCookesHeader(cookies, name string) string

func NewGetRequest

func NewGetRequest(url string) (*http.Request, error)

func NewPostRequest

func NewPostRequest(url string, body io.Reader) (*http.Request, error)

func ReadRespBytes

func ReadRespBytes(resp *http.Response) (bytes []byte, err error)


type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields

func NewHttpClient

func NewHttpClient() *HttpClient

func (*HttpClient) ClearCookie

func (i *HttpClient) ClearCookie()

func (*HttpClient) Do

func (i *HttpClient) Do(req *http.Request) (resp *http.Response, err error)

func (*HttpClient) GetBytes

func (i *HttpClient) GetBytes(url string) (bytes []byte, err error)

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) GetString

func (i *HttpClient) GetString(url string) (str string, err error)

func (HttpClient) PostBytes

func (i HttpClient) PostBytes(url string, data []byte) (bytes []byte, err error)

func (*HttpClient) PostResp

func (i *HttpClient) PostResp(url string, data []byte) (resp *http.Response, 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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL