浏览代码

Adds IndentedJSON

Manu Mtz-Almeida 11 年之前
父节点
当前提交
495e6e116e
共有 1 个文件被更改,包括 4 次插入 和 0 次删除
  1. 4 0
      context.go

+ 4 - 0
context.go

@@ -327,6 +327,10 @@ func (c *Context) JSON(code int, obj interface{}) {
 	c.Render(code, render.JSON, obj)
 }
 
+func (c *Context) IndentedJSON(code int, obj interface{}) {
+	c.Render(code, render.IndentedJSON, obj)
+}
+
 // Serializes the given struct as XML into the response body in a fast and efficient way.
 // It also sets the Content-Type as "application/xml".
 func (c *Context) XML(code int, obj interface{}) {