jsonData, err := json.Marshal(payloadStruct)
Helper.ErrorCheck(err, "Can not create json payload")
- req, err := http.NewRequest(http.MethodPost, ScientiaConfig.Endpoint.Url, bytes.NewBuffer(jsonData))
+ req, err := http.NewRequest(http.MethodPost, ScientiaConfig.Endpoint.Add, bytes.NewBuffer(jsonData))
Helper.ErrorCheck(err, "Can not create http request")
// We need to set the content type from the writer, it includes necessary boundary as well
req.Header.Set("Content-Type", "application/json; charset=UTF-8")
err = decoder.Decode(&ScientiaConfig)
Helper.ErrorCheck(err, "Can not decode config file")
- if ScientiaConfig.Endpoint.Add == "" || ScientiaConfig.Endpoint.Secret == "" {
- log.Fatal("Empty config?")
+ if ScientiaConfig.Endpoint.Add == "" || ScientiaConfig.Endpoint.Get == "" || ScientiaConfig.Endpoint.Secret == "" {
+ log.Fatal("Empty or outdated config?")
}
if FlagDebug {