From 44f5c208b63588f974a505f1659d90997105f364 Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 10 Sep 2013 15:08:32 +0800 Subject: [PATCH] update example --- example/beeapi/controllers/default.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/beeapi/controllers/default.go b/example/beeapi/controllers/default.go index eab48e8d..ca2e0b81 100644 --- a/example/beeapi/controllers/default.go +++ b/example/beeapi/controllers/default.go @@ -12,7 +12,7 @@ type ObjectController struct { func (this *ObjectController) Post() { var ob models.Object - json.Unmarshal(this.Ctx.RequestBody, &ob) + json.Unmarshal(this.Ctx.Input.RequestBody, &ob) objectid := models.AddOne(ob) this.Data["json"] = map[string]string{"ObjectId": objectid} this.ServeJson() @@ -37,7 +37,7 @@ func (this *ObjectController) Get() { func (this *ObjectController) Put() { objectId := this.Ctx.Params[":objectId"] var ob models.Object - json.Unmarshal(this.Ctx.RequestBody, &ob) + json.Unmarshal(this.Ctx.Input.RequestBody, &ob) err := models.Update(objectId, ob.Score) if err != nil {