- 16 May, 2014 23 commits
-
-
astaxie authored
ServeFormatted serve Xml OR Json, depending on the value of the Accept header
-
astaxie authored
-
astaxie authored
gob.Register(v)
-
astaxie authored
default value is true when you Enable Global XSRF, also can control in the prepare function to change the value.
-
astaxie authored
ns := beego.NewNamespace("/v1/api/") ns.Cond(func(ctx *context.Context)bool{ if ctx.Input.Domain() == "www.beego.me" { return true } return false }) .Filter("before", Authenticate) .Router("/order", &admin.OrderController{}) .Get("/version",func (ctx *context.Context) { ctx.Output.Body([]byte("1.0.0")) }) .Post("/login",func (ctx *context.Context) { if ctx.Query("username") == "admin" && ctx.Query("username") == "password" { } }) .Namespace( NewNamespace("/shop"). Get("/order/:id", func(ctx *context.Context) { ctx.Output.Body([]byte(ctx.Input.Param(":id"))) }), )
-
slene authored
-
astaxie authored
//design model beego.Get(router, beego.FilterFunc) beego.Post(router, beego.FilterFunc) beego.Put(router, beego.FilterFunc) beego.Head(router, beego.FilterFunc) beego.Options(router, beego.FilterFunc) beego.Delete(router, beego.FilterFunc) beego.Handler(router, http.Handler) //example beego.Get("/user", func(ctx *context.Context) { ctx.Output.Body([]byte("Get userlist")) }) beego.Post("/user", func(ctx *context.Context) { ctx.Output.Body([]byte("add userlist")) }) beego.Delete("/user/:id", func(ctx *context.Context) { ctx.Output.Body([]byte([]byte(ctx.Input.Param(":id"))) }) import ( "http" "github.com/gorilla/rpc" "github.com/gorilla/rpc/json" ) func init() { s := rpc.NewServer() s.RegisterCodec(json.NewCodec(), "application/json") s.RegisterService(new(HelloService), "") beego.Handler("/rpc", s) }
-
astaxie authored
-
jessonchan authored
-
jessonchan authored
-
toby.zxj authored
-
astaxie authored
-
astaxie authored
-
astaxie authored
-
astaxie authored
-
astaxie authored
-
astaxie authored
-
astaxie authored
-
astaxie authored
// Bind data from request.Form[key] to dest // like /?id=123&isok=true&ft=1.2&ol[0]=1&ol[1]=2&ul[]=str&ul[]=array&user.Name= astaxie // var id int beegoInput.Bind(&id, "id") id ==123 // var isok bool beegoInput.Bind(&isok, "isok") id ==true // var ft float64 beegoInput.Bind(&ft, "ft") ft ==1.2 // ol := make([]int, 0, 2) beegoInput.Bind(&ol, "ol") ol ==[1 2] // ul := make([]string, 0, 2) beegoInput.Bind(&ul, "ul") ul ==[str array] // user struct{Name} beegoInput.Bind(&user, "user") user == {Name:"astaxie"}
-
astaxie authored
-
Lin Luxiang authored
-
Donald Zhan authored
-
Kyle McCullough authored
-
- 14 May, 2014 1 commit
-
-
astaxie authored
Update app.go
-
- 13 May, 2014 1 commit
-
-
Francois authored
-
- 05 May, 2014 4 commits
-
-
astaxie authored
Update Session package README.md
-
luosangnanka authored
Update the json format of session for file, redis, mysql, cookie, there are errors in these json string, such as after the param `ProviderConfig` and there is a lost of `"` in the line 61 of the `gclifetime`.
-
luosangnanka authored
Update the json format of session for file, redis, mysql, there are errors in these json string, after `ProviderConfig` params.
-
luosangnanka authored
Update the json format of session for redis, there is an error in that json string
-
- 14 Apr, 2014 1 commit
-
-
astaxie authored
-
- 10 Apr, 2014 2 commits
- 08 Apr, 2014 3 commits
- 07 Apr, 2014 1 commit
-
-
astaxie authored
-
- 05 Apr, 2014 4 commits