Documentation ¶
Index ¶
- func Signature(client *Client) resty.RequestMiddleware
- type Client
- func (c *Client) Delete(ctx context.Context, req *Request, reply interface{}) (err error)
- func (c *Client) Get(ctx context.Context, req *Request, reply interface{}) (err error)
- func (c *Client) NewRequest(method string, req *Request, reply interface{}) *resty.Request
- func (c *Client) Post(ctx context.Context, req *Request, reply interface{}) (err error)
- func (c *Client) Put(ctx context.Context, req *Request, reply interface{}) (err error)
- func (c *Client) RawDelete(ctx context.Context, req *Request) (reply []byte, err error)
- func (c *Client) RawGet(ctx context.Context, req *Request) (reply []byte, err error)
- func (c *Client) RawPost(ctx context.Context, req *Request) (reply []byte, err error)
- func (c *Client) RawPut(ctx context.Context, req *Request) (reply []byte, err error)
- func (c *Client) Use(m RequestMiddleware) *Client
- type Request
- type RequestMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Signature ¶ added in v1.3.0
func Signature(client *Client) resty.RequestMiddleware
Signature a example of RequestMiddleware sign algorithm:md5(query params + body + secret + timestamp + nonce) Notice:stuff body only when HTTP METHOD is not GET. Encode query params to `"bar=baz&foo=quux"` sorted by key in any case
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client http client
func (*Client) Delete ¶
Delete http delete request Notice that Delete only applied to JSON and XML response MIME type
func (*Client) Get ¶
Get http get request Notice that Get only applied to JSON and XML response MIME type
func (*Client) NewRequest ¶
NewRequest return a resty Request object
func (*Client) Post ¶
Post http post request Notice that Post only applied to JSON and XML response MIME type
func (*Client) Put ¶
Put http put request Notice that Put only applied to JSON and XML response MIME type
func (*Client) RawDelete ¶ added in v1.3.0
RawDelete http delete request and return response body raw byte
func (*Client) RawPost ¶ added in v1.3.0
RawPost http post request and return response body raw byte
func (*Client) Use ¶ added in v1.3.0
func (c *Client) Use(m RequestMiddleware) *Client
Use set client request middleware
type Request ¶
type Request struct { URI string QueryParam url.Values Body interface{} PathParam map[string]string }
Request request params
type RequestMiddleware ¶ added in v1.3.0
type RequestMiddleware func(client *Client) resty.RequestMiddleware
RequestMiddleware http request middleware