mirror of
https://github.com/astaxie/beego.git
synced 2024-11-29 12:11:28 +00:00
json change from Indent to none
This commit is contained in:
parent
51e625debf
commit
a3363b0605
@ -216,7 +216,7 @@ func (c *Controller) Abort(code string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) ServeJson(encoding ...bool) {
|
func (c *Controller) ServeJson(encoding ...bool) {
|
||||||
content, err := json.MarshalIndent(c.Data["json"], "", " ")
|
content, err := json.Marshal(c.Data["json"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError)
|
http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
@ -229,7 +229,7 @@ func (c *Controller) ServeJson(encoding ...bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) ServeJsonp() {
|
func (c *Controller) ServeJsonp() {
|
||||||
content, err := json.MarshalIndent(c.Data["jsonp"], "", " ")
|
content, err := json.Marshal(c.Data["jsonp"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError)
|
http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user