Documentation ¶
Index ¶
- func ClientGet(ctx context.Context, c *http.Client, url string) (resp *http.Response, err error)
- func ClientPost(ctx context.Context, c *http.Client, url, contentType string, body io.Reader) (resp *http.Response, err error)
- func Get(ctx context.Context, url string) (resp *http.Response, err error)
- func Post(ctx context.Context, url, contentType string, body io.Reader) (resp *http.Response, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientGet ¶
ClientGet issues a GET to the specified URL.
Caller should close resp.Body when done reading from it.
func ClientPost ¶
func ClientPost(ctx context.Context, c *http.Client, url, contentType string, body io.Reader) (resp *http.Response, err error)
ClientPost issues a POST to the specified URL.
Caller should close resp.Body when done reading from it.
If the provided body is an io.Closer, it is closed after the request.
To set custom headers, use NewRequestWithContext and Client.Do.
func Get ¶
Get issues a GET to the specified URL using DefaultClient.
Caller should close resp.Body when done reading from it.
func Post ¶
func Post(ctx context.Context, url, contentType string, body io.Reader) (resp *http.Response, err error)
Post issues a POST to the specified URL using DefaultClient.
Caller should close resp.Body when done reading from it.
If the provided body is an io.Closer, it is closed after the request.
To set custom headers, use NewRequestWithContext and Client.Do.
Types ¶
This section is empty.