refactor: httpc package for easy to use (#1645)
This commit is contained in:
@@ -6,16 +6,16 @@ import (
|
||||
)
|
||||
|
||||
// Do sends an HTTP request to the service assocated with the given key.
|
||||
func Do(key string, r *http.Request, opts ...Option) (*http.Response, error) {
|
||||
return NewService(key, opts...).Do(r)
|
||||
func Do(key string, r *http.Request) (*http.Response, error) {
|
||||
return NewService(key).Do(r)
|
||||
}
|
||||
|
||||
// Get sends an HTTP GET request to the service assocated with the given key.
|
||||
func Get(key, url string, opts ...Option) (*http.Response, error) {
|
||||
return NewService(key, opts...).Get(url)
|
||||
func Get(key, url string) (*http.Response, error) {
|
||||
return NewService(key).Get(url)
|
||||
}
|
||||
|
||||
// Post sends an HTTP POST request to the service assocated with the given key.
|
||||
func Post(key, url, contentType string, body io.Reader, opts ...Option) (*http.Response, error) {
|
||||
return NewService(key, opts...).Post(url, contentType, body)
|
||||
func Post(key, url, contentType string, body io.Reader) (*http.Response, error) {
|
||||
return NewService(key).Post(url, contentType, body)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user