Documentation ¶
Index ¶
- func Export(v interface{}) string
- func IntByte(v interface{}) []byte
- func Json(v interface{}) string
- type Cookies
- type Data
- type Fields
- type Headers
- type Request
- func CheckRedirect(v func(req *http.Request, via []*http.Request) error) *Request
- func Debug(v bool) *Request
- func DisableKeepAlive(v bool) *Request
- func JSON() *Request
- func Jar(v http.CookieJar) *Request
- func NewRequest() *Request
- func Proxy(v func(*http.Request) (*url.URL, error)) *Request
- func SetBasicAuth(username, password string) *Request
- func SetCookies(cookies map[string]string) *Request
- func SetHeaders(headers map[string]string) *Request
- func SetTLSClient(v *tls.Config) *Request
- func SetTimeout(d time.Duration) *Request
- func TLSClient(v *tls.Config) *Request
- func Transport(v *http.Transport) *Request
- func (r *Request) CheckRedirect(v func(req *http.Request, via []*http.Request) error) *Request
- func (r *Request) Debug(v bool) *Request
- func (r *Request) Delete(url string, data ...interface{}) (*Response, error)
- func (r *Request) DisableKeepAlive(v bool) *Request
- func (r *Request) Get(url string, data ...interface{}) (*Response, error)
- func (r *Request) JSON() *Request
- func (r *Request) Jar(v http.CookieJar) *Request
- func (r *Request) Post(url string, data ...interface{}) (*Response, error)
- func (r *Request) PostJSON(url string, data ...interface{}) (*Response, error)
- func (r *Request) Proxy(v func(*http.Request) (*url.URL, error)) *Request
- func (r *Request) Put(url string, data ...interface{}) (*Response, error)
- func (r *Request) Send(method, url string, data ...interface{}) (*Response, error)
- func (r *Request) SetAuthHeader(token string) *Request
- func (r *Request) SetBasicAuth(username, password string) *Request
- func (r *Request) SetCookies(cookies map[string]string) *Request
- func (r *Request) SetHeaders(headers map[string]string) *Request
- func (r *Request) SetHost(host string) *Request
- func (r *Request) SetTLSClient(v *tls.Config) *Request
- func (r *Request) SetTimeout(d time.Duration) *Request
- func (r *Request) TLSClient(v *tls.Config) *Request
- func (r *Request) Transport(v *http.Transport) *Request
- func (r *Request) Upload(url, filename, fileInput string) (*Response, error)
- type Response
- func Delete(url string, data ...interface{}) (*Response, error)
- func Get(url string, data ...interface{}) (*Response, error)
- func Post(url string, data ...interface{}) (*Response, error)
- func Put(url string, data ...interface{}) (*Response, error)
- func Upload(url, filename, fileinput string) (*Response, error)
- func (r *Response) Body() ([]byte, error)
- func (r *Response) Close() error
- func (r *Response) Content() (string, error)
- func (r *Response) ContentLength() int64
- func (r *Response) Cookies() []*http.Cookie
- func (r *Response) Export() (string, error)
- func (r *Response) Headers() http.Header
- func (r *Response) Json(v interface{}) error
- func (r *Response) Response() *http.Response
- func (r *Response) Result() gjson.Result
- func (r *Response) StatusCode() int
- func (r *Response) Text() string
- func (r *Response) Time() int64
- func (r *Response) Unmarshal(v interface{}) error
- func (r *Response) Url() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func CheckRedirect ¶ added in v1.0.1
func DisableKeepAlive ¶
func NewRequest ¶
func NewRequest() *Request
func SetBasicAuth ¶ added in v1.0.1
func SetCookies ¶ added in v1.0.1
func SetHeaders ¶ added in v1.0.1
func SetTLSClient ¶ added in v1.0.1
func SetTimeout ¶ added in v1.0.1
func (*Request) CheckRedirect ¶ added in v1.0.1
func (*Request) DisableKeepAlive ¶
func (*Request) SetAuthHeader ¶
设置 Authorization 的 Token
func (*Request) SetBasicAuth ¶ added in v1.0.1
Set basic auth
func (*Request) SetCookies ¶
Set cookies
type Response ¶
type Response struct { R *http.Response Req *http.Request // contains filtered or unexported fields }
func (*Response) ContentLength ¶ added in v1.1.2
func (*Response) StatusCode ¶
Click to show internal directories.
Click to hide internal directories.