Refactor message sending into logic package (+ more tests for uptime-kuma)
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
package util
|
||||
|
||||
type FormData map[string]string
|
||||
|
||||
type RawJSON struct {
|
||||
ContentType string
|
||||
Body string
|
||||
}
|
||||
|
||||
@@ -114,6 +114,9 @@ func RequestAny[TResult any](t *testing.T, akey string, method string, baseURL s
|
||||
}
|
||||
bytesbody = bodybuffer.Bytes()
|
||||
contentType = writer.FormDataContentType()
|
||||
case RawJSON:
|
||||
bytesbody = []byte(body.(RawJSON).Body)
|
||||
contentType = "application/json"
|
||||
default:
|
||||
bjson, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user