{"modulePath":"github.com/UnderTreeTech/waterdrop","version":"v1.3.8","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\n## Functions\n\n```go\nfunc Signature(client *Client) resty.RequestMiddleware\n```\nSignature 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\u0026foo=quux\"\\` sorted by key in any case\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient http client\n\n```go\nfunc New(config *config.ClientConfig) *Client\n```\nNew return a http client\n\n```go\nfunc (c *Client) Delete(ctx context.Context, req *Request, reply interface{}) (err error)\n```\nDelete http delete request Notice that Delete only applied to JSON and XML response MIME type\n\n```go\nfunc (c *Client) Get(ctx context.Context, req *Request, reply interface{}) (err error)\n```\nGet http get request Notice that Get only applied to JSON and XML response MIME type\n\n```go\nfunc (c *Client) Post(ctx context.Context, req *Request, reply interface{}) (err error)\n```\nPost http post request Notice that Post only applied to JSON and XML response MIME type\n\n```go\nfunc (c *Client) Put(ctx context.Context, req *Request, reply interface{}) (err error)\n```\nPut http put request Notice that Put only applied to JSON and XML response MIME type\n\n```go\nfunc (c *Client) RawDelete(ctx context.Context, req *Request) (reply []byte, err error)\n```\nRawDelete http delete request and return response body raw byte\n\n```go\nfunc (c *Client) RawGet(ctx context.Context, req *Request) (reply []byte, err error)\n```\nRawGet http get request and return response body raw byte\n\n```go\nfunc (c *Client) RawPost(ctx context.Context, req *Request) (reply []byte, err error)\n```\nRawPost http post request and return response body raw byte\n\n```go\nfunc (c *Client) RawPut(ctx context.Context, req *Request) (reply []byte, err error)\n```\nRawPut http put request and return response body raw byte\n\n```go\nfunc (c *Client) Use(m RequestMiddleware) *Client\n```\nUse set client request middleware\n\n```go\ntype Request struct {\n\tURI        string\n\tQueryParam url.Values\n\tBody       interface{}\n\tPathParam  map[string]string\n\tHeaders    map[string]string\n\tError      interface{}\n}\n```\nRequest request params\n\n```go\ntype RequestMiddleware func(client *Client) resty.RequestMiddleware\n```\nRequestMiddleware http request middleware\n\n","path":"github.com/UnderTreeTech/waterdrop/pkg/server/http/client","name":"client","synopsis":"","isRedistributable":true}
