mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-05-17 13:20:16 +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"
|
// @Param data body SendMessageV2 true "Input Data"
|
||||||
// @Router /v2/send [post]
|
// @Router /v2/send [post]
|
||||||
func (a *Api) SendV2(c *gin.Context) {
|
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
|
var req SendMessageV2
|
||||||
err := c.BindJSON(&req)
|
err := json.Unmarshal(body, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(400, gin.H{"error": "Couldn't process request - invalid request"})
|
c.JSON(400, gin.H{"error": "Couldn't process request - invalid request"})
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user