httpc

package
v0.0.0-...-29df642 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CookieJar

type CookieJar struct {
	// contains filtered or unexported fields
}

func NewCookieJar

func NewCookieJar() *CookieJar

func (*CookieJar) Cookies

func (j *CookieJar) Cookies(u *url.URL) (cookies []*http.Cookie)

func (*CookieJar) SetCookies

func (j *CookieJar) SetCookies(u *url.URL, cookies []*http.Cookie)

type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient() *HttpClient

func (*HttpClient) SetCookieJar

func (this *HttpClient) SetCookieJar(j *CookieJar) *HttpClient

func (*HttpClient) SetProxy

func (this *HttpClient) SetProxy(proxyUrl string)

func (*HttpClient) SetRedirect

func (this *HttpClient) SetRedirect(f func(req *http.Request, via []*http.Request) error) *HttpClient

func (*HttpClient) SetSkipVerify

func (this *HttpClient) SetSkipVerify(isSkipVerify bool)

func (*HttpClient) SetTimeout

func (this *HttpClient) SetTimeout(t time.Duration) *HttpClient

func (*HttpClient) SetTransport

func (this *HttpClient) SetTransport(t *http.Transport) *HttpClient

type Request

type Request struct {
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(client *HttpClient) *Request

func (*Request) End

func (this *Request) End() (*http.Response, string, error)

func (*Request) EndByte

func (this *Request) EndByte() (*http.Response, []byte, error)

func (*Request) EndFile

func (this *Request) EndFile(savePath, saveFileName string) (*http.Response, error)

func (*Request) Send

func (this *Request) Send(a ...interface{}) *Request

func (*Request) SetCookies

func (this *Request) SetCookies(cookies *[]*http.Cookie) *Request

func (*Request) SetData

func (this *Request) SetData(name, value string) *Request

func (*Request) SetDebug

func (this *Request) SetDebug(d bool) *Request

func (*Request) SetFileData

func (this *Request) SetFileData(name, value string, isFile bool) *Request

func (*Request) SetHeader

func (this *Request) SetHeader(name, value string) *Request

func (*Request) SetJsonData

func (this *Request) SetJsonData(s string) *Request

func (*Request) SetMethod

func (this *Request) SetMethod(name string) *Request

func (*Request) SetUrl

func (this *Request) SetUrl(url string) *Request

Jump to

Keyboard shortcuts

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