Documentation ¶
Index ¶
- type Request
- func BaseURL(url string) Request
- func Cookie(c *http.Cookie) Request
- func Header(key, val string) Request
- func New() Request
- func Proxy(url string) Request
- func Query(query interface{}) Request
- func Timeout(timeout time.Duration) Request
- func Type(name string) Request
- func UseRequest(mdl requestMiddlewareHandler) Request
- func UseResponse(mdl responseMidlewareHandler) Request
- func UserAgent(name string) Request
- func (r Request) BaseURL(url string) Request
- func (r Request) Clone() Request
- func (r Request) Cookie(c *http.Cookie) Request
- func (r Request) Del(url string, body interface{}) (*Response, error)
- func (r Request) Do(method, url string, query, body, file interface{}) (*Response, error)
- func (r Request) Get(url string, query interface{}) (*Response, error)
- func (r Request) Head(url string, query interface{}) (*Response, error)
- func (r Request) Header(key, val string) Request
- func (r Request) Options(url string, query interface{}) (*Response, error)
- func (r Request) Patch(url string, body interface{}) (*Response, error)
- func (r Request) Post(url string, body interface{}) (*Response, error)
- func (r Request) PostFile(url string, file interface{}, body interface{}) (*Response, error)
- func (r Request) Proxy(url string) Request
- func (r Request) Put(url string, body interface{}) (*Response, error)
- func (r Request) PutFile(url string, file interface{}, body interface{}) (*Response, error)
- func (r Request) Query(query interface{}) Request
- func (r Request) Timeout(timeout time.Duration) Request
- func (r Request) Type(name string) Request
- func (r Request) UseRequest(mdl requestMiddlewareHandler) Request
- func (r Request) UseResponse(mdl responseMidlewareHandler) Request
- func (r Request) UserAgent(name string) Request
- type Response
- func Del(url string, body interface{}) (*Response, error)
- func Get(url string, query interface{}) (*Response, error)
- func Head(url string, query interface{}) (*Response, error)
- func NewResponse() *Response
- func Options(url string, query interface{}) (*Response, error)
- func Patch(url string, body interface{}) (*Response, error)
- func Post(url string, body interface{}) (*Response, error)
- func PostFile(url string, file interface{}, body interface{}) (*Response, error)
- func Put(url string, body interface{}) (*Response, error)
- func PutFile(url string, file interface{}, body interface{}) (*Response, error)
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { SuperAgent *gorequest.SuperAgent // contains filtered or unexported fields }
Request 请求结构
func (Request) PostFile ¶
PostFile 发起 post 请求上传文件,将使用表单提交,file 是文件地址或者文件流, body 是请求带的参数,可使用json字符串或者结构体
func (Request) PutFile ¶
PutFile 发起 put 请求上传文件,将使用表单提交,file 是文件地址或者文件流, body 是请求带的参数,可使用json字符串或者结构体
func (Request) UseRequest ¶
UseRequest 增加请求中间件
func (Request) UseResponse ¶
UseResponse 增加响应中间件
type Response ¶
type Response struct { Request *Request Raw *http.Response Body []byte Errs ResponseError }
Response 回应对象
Click to show internal directories.
Click to hide internal directories.