mirror of
https://github.com/beego/bee.git
synced 2024-11-22 05:00:54 +00:00
fix post data format
This commit is contained in:
parent
aa51639b25
commit
916e701580
@ -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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user