Documentation ¶
Index ¶
- type Client
- func (c *Client) CloseIdleConnections(ctx context.Context)
- func (c *Client) Do(ctx context.Context, method, addr string, req *resty.Request) (resp *resty.Response, err error)
- func (c *Client) Get(ctx context.Context, addr string) (resp *http.Response, err error)
- func (c *Client) Post(ctx context.Context, addr, contentType string, body io.Reader) (resp *http.Response, err error)
- func (c *Client) PostForm(ctx context.Context, addr string, data url.Values) (resp *http.Response, err error)
- func (c *Client) RC() *resty.Client
- func (c *Client) RequestGet(ctx context.Context, addr string, header map[string]string) (*resty.Response, error)
- func (c *Client) RequestPost(ctx context.Context, addr string, data interface{}, header map[string]string) (*resty.Response, error)
- func (c *Client) RequestPostJson(ctx context.Context, addr string, data interface{}) (*resty.Response, error)
- func (c *Client) SendGet(ctx context.Context, addr string) (rtyResp *resty.Response, err error)
- func (c *Client) SendPost(ctx context.Context, addr, contentType string, body io.Reader) (rtyResp *resty.Response, err error)
- func (c *Client) SetTimeout(ttl time.Duration) *Client
- func (c *Client) SetTransport(transport http.RoundTripper) *Client
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CloseIdleConnections ¶
func (*Client) Get ¶
---------------------------------------------------------------------------------------------- // ----------------------------------------- 兼容旧方法 ------------------------------------------ // --------------------------------------- 以下方法不建议使用 -------------------------------------- // --------------------------------------------------------------------------------------------- //
func (*Client) RequestGet ¶
func (*Client) RequestPost ¶
func (*Client) RequestPostJson ¶
func (*Client) SetTransport ¶
func (c *Client) SetTransport(transport http.RoundTripper) *Client
Click to show internal directories.
Click to hide internal directories.