1
0
mirror of https://github.com/beego/bee.git synced 2025-07-01 22:20:17 +00:00

fix post data format

This commit is contained in:
astaxie
2013-08-19 10:27:44 +08:00
parent aa51639b25
commit 916e701580

View File

@ -19,9 +19,9 @@ In the current path, will create a folder named [appname]
In the appname folder has the follow struct: In the appname folder has the follow struct:
├── conf ├── conf
   └── app.conf └── app.conf
├── controllers ├── controllers
   └── default.go └── default.go
├── main.go ├── main.go
└── models └── models
└── object.go └── object.go
@ -130,7 +130,7 @@ func (this *ObejctController) Post() {
var ob models.Object var ob models.Object
json.Unmarshal(this.Ctx.RequestBody, &ob) json.Unmarshal(this.Ctx.RequestBody, &ob)
objectid := models.AddOne(ob) objectid := models.AddOne(ob)
this.Data["json"] = "{\"ObjectId\":\"" + objectid + "\"}" this.Data["json"] = map[string]string{"ObjectId": objectid}
this.ServeJson() this.ServeJson()
} }