Documentation
¶
Index ¶
- type Client
- func (c *Client) Delete(ctx context.Context, url string, headers ...Header) (*http.Response, error)
- func (c *Client) DeleteJSON(ctx context.Context, url string, headers ...Header) (*http.Response, error)
- func (c *Client) DeleteJsonWithAuth(ctx context.Context, url string, token string, headers ...Header) (*http.Response, error)
- func (c *Client) DeleteWithAuth(ctx context.Context, url string, token string, headers ...Header) (*http.Response, error)
- func (c *Client) Get(ctx context.Context, url string, headers ...Header) (*http.Response, error)
- func (c *Client) GetJSON(ctx context.Context, url string, headers ...Header) (*http.Response, error)
- func (c *Client) GetJsonWithAuth(ctx context.Context, url string, token string, headers ...Header) (*http.Response, error)
- func (c *Client) GetWithAuth(ctx context.Context, url string, token string, headers ...Header) (*http.Response, error)
- func (c *Client) Post(ctx context.Context, url string, body []byte, headers ...Header) (*http.Response, error)
- func (c *Client) PostJSON(ctx context.Context, url string, data interface{}, headers ...Header) (*http.Response, error)
- func (c *Client) PostJsonWithAuth(ctx context.Context, url string, token string, data interface{}, ...) (*http.Response, error)
- func (c *Client) PostWithAuth(ctx context.Context, url string, token string, body []byte, headers ...Header) (*http.Response, error)
- func (c *Client) Put(ctx context.Context, url string, body []byte, headers ...Header) (*http.Response, error)
- func (c *Client) PutJSON(ctx context.Context, url string, data interface{}, headers ...Header) (*http.Response, error)
- func (c *Client) PutJsonWithAuth(ctx context.Context, url string, token string, data interface{}, ...) (*http.Response, error)
- func (c *Client) PutWithAuth(ctx context.Context, url string, token string, body []byte, headers ...Header) (*http.Response, error)
- func (c *Client) Request(ctx context.Context, method, url string, body []byte, headers ...Header) (*http.Response, error)
- func (c *Client) RequestJSON(ctx context.Context, method, url string, data interface{}, headers ...Header) (*http.Response, error)
- type Header
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 NewClient ¶
func NewClient(timeout time.Duration, transport http.RoundTripper) *Client
NewClient create a new httpgo client, if transport is nil, the client uses `http.DefaultTransport`.
func (*Client) DeleteJSON ¶
func (*Client) DeleteJsonWithAuth ¶
func (*Client) DeleteWithAuth ¶ added in v1.2.0
func (*Client) GetJsonWithAuth ¶
func (*Client) GetWithAuth ¶ added in v1.2.0
func (*Client) PostJsonWithAuth ¶
func (*Client) PostWithAuth ¶ added in v1.2.0
func (*Client) PutJsonWithAuth ¶
func (*Client) PutWithAuth ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.