ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
获取参数 === ### 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) } ~~~