合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
获取参数 === ### beego 获取 get、post 参数 `value := c.GetString("key")` ~~~ type MainController struct { beego.Controller } func (c *MainController) Get() { name := c.GetString("name") log.Println(name) c.Data["Name"] = name c.Data["Website"] = "beego.me" c.Data["Email"] = "astaxie@gmail.com" c.TplName = "index.tpl" } type ResponseJson map[string]interface{} func (c *MainController) Post() { name := c.GetString("name") data := &ResponseJson{ "name":name, } bytes, _ := json.Marshal(data) c.Ctx.ResponseWriter.Header().Set("Content-type","application/json") c.Ctx.Output.Body(bytes) } ~~~