From adfdde28dd081b4de8a26d3716d8c2154fe5eadd Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Sun, 29 Aug 2021 21:37:26 +0200 Subject: [PATCH] just some debugging --- src/api/api.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/api/api.go b/src/api/api.go index d88587e..8e51444 100644 --- a/src/api/api.go +++ b/src/api/api.go @@ -574,8 +574,16 @@ func (a *Api) Send(c *gin.Context) { // @Param data body SendMessageV2 true "Input Data" // @Router /v2/send [post] func (a *Api) SendV2(c *gin.Context) { + body, err1 := ioutil.ReadAll(c.Request.Body) + if err1 != nil { + log.Error("Couldn't read request body", err1.Error()) + c.JSON(400, gin.H{"error": "Couldn't process request - invalid request"}) + return + } + log.Info(string(body)) + var req SendMessageV2 - err := c.BindJSON(&req) + err := json.Unmarshal(body, &req) if err != nil { c.JSON(400, gin.H{"error": "Couldn't process request - invalid request"}) log.Error(err.Error())