beego的默認架構是mvc python的django默認是mtvpython
package main import ( "github.com/astaxie/beego" ) type MainController struct { beego.Controller } func (this *MainController) Get(){ this.Ctx.WriteString("hello mybeego") } func(this *MainController) Post(){ user := this.GetString("username") //只能回去urlencode 爲a=1&b=2格式 //pwd := this.GetString("password") if user == ""{ this.Ctx.WriteString("username not get,please check it") }else{ this.Ctx.WriteString("111") } } func main(){ beego.Router("/",&MainController{}) beego.Run("127.0.0.1:9999") }