mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-12-26 03:51:45 +00:00
marshaling json data manually
This commit is contained in:
parent
43e2e18ded
commit
82270c6d57
10
main.go
10
main.go
@ -117,6 +117,16 @@ func LoadMatrixData() (string, int, int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SendRequest(client *resty.Client, url string, ins []interface{}) {
|
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
|
// Build and send request
|
||||||
resp, err := client.R().
|
resp, err := client.R().
|
||||||
SetHeader("Content-Type", "application/json").
|
SetHeader("Content-Type", "application/json").
|
||||||
|
Loading…
Reference in New Issue
Block a user