Documentation ¶
Index ¶
- func Delete(result interface{}, url string, params ...KV) error
- func Get(result interface{}, url string, params ...KV) error
- func Patch(result interface{}, url string, body interface{}) error
- func Post(result interface{}, url string, body interface{}) error
- func Put(result interface{}, url string, body interface{}) error
- type KV
- type Request
- func (req *Request) CustomRequest(f func(req *http.Request, data *bytes.Buffer)) *Request
- func (req *Request) DELETE() (*Response, error)
- func (req *Request) Do(method string, data interface{}) (*Response, error)
- func (req *Request) GET() (*Response, error)
- func (req *Request) PATCH() (*Response, error)
- func (req *Request) POST() (*Response, error)
- func (req *Request) PUT() (*Response, error)
- func (req *Request) Reset()
- func (req *Request) Response() (*Response, error)
- func (req *Request) SetBody(body string) *Request
- func (req *Request) SetContentType(a string) *Request
- func (req *Request) SetHeader(k, v string) *Request
- func (req *Request) SetHeaders(headers map[string]string) *Request
- func (req *Request) SetJSONBody(body interface{}) *Request
- func (req *Request) SetParam(k string, v interface{}) *Request
- func (req *Request) SetParams(params map[string]interface{}) *Request
- func (req *Request) SetTimeout(t time.Duration) *Request
- func (req *Request) SetURL(path string) *Request
- type Response
- type StdResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request HTTP request
func (*Request) CustomRequest ¶
CustomRequest 自定义Request, 如添加sign, 设置header等
func (*Request) Reset ¶
func (req *Request) Reset()
Reset set all fields to default value, use at pool
func (*Request) SetContentType ¶
SetContentType 设置ContentType
func (*Request) SetHeaders ¶ added in v1.2.0
SetHeaders 设置Request Headers 的值
func (*Request) SetJSONBody ¶
SetJSONBody 设置Body数据, JSON格式
func (*Request) SetTimeout ¶
SetTimeout 超时时间
Click to show internal directories.
Click to hide internal directories.