mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
Refactored flags and added xnames to add endpoint to hms-smd
This commit is contained in:
parent
de07b119b5
commit
2edb9fdbb0
18 changed files with 270 additions and 175 deletions
|
|
@ -8,10 +8,13 @@ import (
|
|||
)
|
||||
|
||||
|
||||
func MakeRequest(url string, httpMethod string, body []byte) (*http.Response, []byte, error) {
|
||||
func MakeRequest(url string, httpMethod string, body []byte, headers map[string]string) (*http.Response, []byte, error) {
|
||||
// url := getSmdEndpointUrl(endpoint)
|
||||
req, _ := http.NewRequest(httpMethod, url, bytes.NewBuffer(body))
|
||||
req.Header.Add("User-Agent", "magellan")
|
||||
for k, v := range headers {
|
||||
req.Header.Add(k, v)
|
||||
}
|
||||
res, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("could not make request: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue