Documentation ¶
Index ¶
- Constants
- type Auth
- type DataItem
- type Files
- type Header
- type Params
- type Request
- func (req *Request) ClearCookies()
- func (req *Request) ClientSetCookies()
- func (req *Request) Get(origUrl string, args ...interface{}) (resp *Response, err error)
- func (req *Request) Post(origUrl string, args ...interface{}) (resp *Response, err error)
- func (req *Request) PostJson(origUrl string, args ...interface{}) (resp *Response, err error)
- func (req *Request) Proxy(proxyUrl string)
- func (req *Request) RequestDebug()
- func (req *Request) Send(method, origUrl string, args ...interface{}) (resp *Response, err error)
- func (req *Request) SetCookie(cookie *http.Cookie)
- func (req *Request) SetTimeout(n time.Duration)
- type Response
- func (resp *Response) Content() []byte
- func (resp *Response) Cookies() (cookies []*http.Cookie)
- func (resp *Response) Json() (map[string]interface{}, error)
- func (resp *Response) ResponseDebug()
- func (resp *Response) Result() gjson.Result
- func (resp *Response) SaveFile(filename string) error
- func (resp *Response) Text() string
- func (resp *Response) Unmarshal(v interface{}) error
Constants ¶
View Source
const ( TypeJSON = "application/json" TypeXML = "application/xml" TypeForm = "application/x-www-form-urlencoded" TypeFormData = "application/x-www-form-urlencoded" TypeUrlencoded = "application/x-www-form-urlencoded" TypeHTML = "text/html" TypeText = "text/plain" TypeMultipart = "multipart/form-data" )
支持的请求类型
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Header *http.Header Client *http.Client Debug int Host string Cookies []*http.Cookie // contains filtered or unexported fields }
封装请求结构体
func (*Request) ClearCookies ¶
func (req *Request) ClearCookies()
func (*Request) ClientSetCookies ¶
func (req *Request) ClientSetCookies()
func (*Request) RequestDebug ¶
func (req *Request) RequestDebug()
Click to show internal directories.
Click to hide internal directories.