Fix API paths

This commit is contained in:
Neil Alexander 2020-05-22 14:14:39 +01:00
parent 0978630b55
commit 06d5f1e6dc
6 changed files with 12 additions and 22 deletions

View file

@ -6,8 +6,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
opentracing "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
@ -23,14 +21,6 @@ func PostJSON(
return err
}
parsedAPIURL, err := url.Parse(apiURL)
if err != nil {
return err
}
parsedAPIURL.Path = "/api/" + strings.TrimLeft(parsedAPIURL.Path, "/")
apiURL = parsedAPIURL.String()
req, err := http.NewRequest(http.MethodPost, apiURL, bytes.NewReader(jsonBytes))
if err != nil {
return err