Added baseURL for rest api clients
This commit is contained in:
@@ -7,11 +7,12 @@ import (
|
||||
)
|
||||
|
||||
type HttpClient struct {
|
||||
baseURL string
|
||||
userAgent string
|
||||
}
|
||||
|
||||
func NewHttpClient() *HttpClient {
|
||||
return &HttpClient{userAgent: "internal-http-client"}
|
||||
func NewHttpClient(apiURL string) *HttpClient {
|
||||
return &HttpClient{baseURL: apiURL, userAgent: "internal-http-client"}
|
||||
}
|
||||
|
||||
func (c *HttpClient) SendGet(api, url string, data, out any) error {
|
||||
|
||||
Reference in New Issue
Block a user