Update main.go
This commit is contained in:
4
main.go
4
main.go
@@ -169,12 +169,12 @@ func forwardToDawarich(gpsData GPSData) ForwardResult {
|
|||||||
return ForwardResult{Success: false, Error: "JSON marshal error"}
|
return ForwardResult{Success: false, Error: "JSON marshal error"}
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := http.NewRequest("POST", config.Dawarich.URL+"/api/v1/overland/batches", bytes.NewBuffer(jsonData))
|
url := config.Dawarich.URL + "/api/v1/overland/batches?api_key=" + config.Dawarich.Token
|
||||||
|
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ForwardResult{Success: false, Error: "Request creation error"}
|
return ForwardResult{Success: false, Error: "Request creation error"}
|
||||||
}
|
}
|
||||||
|
|
||||||
req.Header.Set("Authorization", "Bearer "+config.Dawarich.Token)
|
|
||||||
req.Header.Set("Content-Type", "application/json")
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
resp, err := httpClient.Do(req)
|
resp, err := httpClient.Do(req)
|
||||||
|
|||||||
Reference in New Issue
Block a user