Documentation
¶
Index ¶
- func EncodeURL(api string, queries map[string]interface{}) (string, error)
- type CommonError
- type CommonResult
- type ContentType
- type Request
- func (cli *Request) FormPost(ctx context.Context, url, field, filename string, reader io.Reader, ...) error
- func (cli *Request) FormPostWithFile(ctx context.Context, url, field, filename string, response interface{}) error
- func (cli *Request) Get(ctx context.Context, url string, response interface{}) error
- func (cli *Request) GetWithBody(ctx context.Context, url string) (*http.Response, error)
- func (cli *Request) Post(ctx context.Context, url string, params interface{}, response interface{}) error
- func (cli *Request) PostWithBody(ctx context.Context, url string, params interface{}) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommonError ¶
type CommonError struct { ErrCode int `json:"errcode"` // 错误码 ErrMSG string `json:"errmsg"` // 错误描述 }
CommonError 微信返回错误信息
func (CommonError) GetResponseError ¶
func (err CommonError) GetResponseError() error
GetResponseError 获取微信服务器错返回误信息
type CommonResult ¶
type CommonResult struct { ResultCode int `json:"resultcode"` // 错误码 ResultMsg string `json:"resultmsg"` // 错误描述 }
CommonResult 微信返回错误信息
func (CommonResult) GetResponseError ¶
func (err CommonResult) GetResponseError() error
GetResponseError 获取微信服务器错返回误信息
type ContentType ¶
type ContentType uint
消息返回数据类型
const ( ContentTypePlain ContentType = iota ContentTypeXML ContentTypeJSON )
func (ContentType) String ¶
func (ctp ContentType) String() string
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest(http *http.Client, ctp ContentType) *Request
func (*Request) FormPostWithFile ¶
func (*Request) GetWithBody ¶
Click to show internal directories.
Click to hide internal directories.