mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-01-26 19:03:33 +00:00
just some debugging
This commit is contained in:
parent
85dfe199f3
commit
adfdde28dd
@ -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())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user