Booking trace API
This commit is contained in:
@@ -60,7 +60,7 @@ func (a *API) CheckRemotePeer(url string) State {
|
||||
// Check if the database is up
|
||||
caller := NewHTTPCaller(map[string]map[METHOD]string{})
|
||||
var resp APIStatusResponse
|
||||
b, err := caller.CallGet(url, "/status")
|
||||
b, err := caller.CallPost(url, "/status", []string{})
|
||||
if err != nil {
|
||||
return DEAD
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ func (caller *HTTPCaller) CallDelete(url string, subpath string) ([]byte, error)
|
||||
return io.ReadAll(resp.Body)
|
||||
}
|
||||
|
||||
func (caller *HTTPCaller) CallPost(url string, subpath string, body map[string]interface{}) ([]byte, error) {
|
||||
func (caller *HTTPCaller) CallPost(url string, subpath string, body interface{}) ([]byte, error) {
|
||||
postBody, _ := json.Marshal(body)
|
||||
responseBody := bytes.NewBuffer(postBody)
|
||||
resp, err := http.Post(url+subpath, "application/json", responseBody)
|
||||
|
Reference in New Issue
Block a user