Documentation ¶
Index ¶
- Constants
- func AddRequestInterceptors(interceptors ...RequestInterceptor)
- type Client
- func (c *Client) Form(form url.Values) *Client
- func (c *Client) Header(k, v string) *Client
- func (c *Client) Headers(header http.Header) *Client
- func (c *Client) Json(json interface{}) *Client
- func (c *Client) Multipart(multipart FileForm) *Client
- func (c *Client) Params(params url.Values) *Client
- func (c *Client) Send() *Result
- type FileForm
- type RequestInterceptor
- type Result
Constants ¶
View Source
const ( ContentType = "Content-Type" ApplicationJSON = "application/json" ApplicationFormUrlencoded = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func AddRequestInterceptors ¶
func AddRequestInterceptors(interceptors ...RequestInterceptor)
AddRequestInterceptors 添加请求拦截器
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 封装了http的参数等信息
func Request ¶
Request 用于自定义请求方式,比如`HEAD`、`PATCH`、`OPTIONS`、`TRACE` client参数用于替换DefaultClient,如果为nil则会使用默认的
type RequestInterceptor ¶
RequestInterceptor 请求拦截器 返回不为nil,即有错误会终止后续执行
Click to show internal directories.
Click to hide internal directories.