package controllers import ( "fmt" "net/http" beego "github.com/astaxie/beego/adapter" ) type EclpController struct { beego.Controller } func (c *EclpController) Msg() { if c.Ctx.Input.Method() == http.MethodPost { fmt.Println("testElcp", c.Ctx.Request.Body) c.Data["json"] = c.Ctx.Request.Body c.ServeJSON() } else { c.Abort("404") } }