From 82270c6d570038f5dd477182128e108461562758 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Fri, 12 Apr 2024 10:49:49 +0200 Subject: [PATCH] marshaling json data manually --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index ad3b81f..369a0a3 100644 --- a/main.go +++ b/main.go @@ -117,6 +117,16 @@ func LoadMatrixData() (string, int, int) { } func SendRequest(client *resty.Client, url string, ins []interface{}) { + // Manually marshal instructions + marshal, err := json.Marshal(ins) + if err != nil { + log.Fatal(err) + return + } + + // Debug log json data + log.Printf("Request: %s\n", string(marshal)) + // Build and send request resp, err := client.R(). SetHeader("Content-Type", "application/json").