mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-26 03:51:45 +00:00
additional commenting
This commit is contained in:
parent
90f577820e
commit
e436850d7b
3
main.go
3
main.go
@ -116,16 +116,19 @@ func LoadMatrixData() (string, int, int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SendRequest(client *resty.Client, url string, ins []interface{}) {
|
func SendRequest(client *resty.Client, url string, ins []interface{}) {
|
||||||
|
// Build and send request
|
||||||
resp, err := client.R().
|
resp, err := client.R().
|
||||||
SetHeader("Content-Type", "application/json").
|
SetHeader("Content-Type", "application/json").
|
||||||
SetBody(ins).
|
SetBody(ins).
|
||||||
Post(fmt.Sprintf("%s/instructions", url))
|
Post(fmt.Sprintf("%s/instructions", url))
|
||||||
|
|
||||||
|
// Error handling
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print response status
|
||||||
log.Printf("Response Status: %s\n", resp.Status())
|
log.Printf("Response Status: %s\n", resp.Status())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user