2018-08-20 10:15:31 +03:00
|
|
|
// Copyright 2018 Gin Core Team. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// +build go1.7
|
|
|
|
|
|
|
|
package gin
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gin-gonic/gin/render"
|
|
|
|
)
|
|
|
|
|
|
|
|
// PureJSON serializes the given struct as JSON into the response body.
|
|
|
|
// PureJSON, unlike JSON, does not replace special html characters with their unicode entities.
|
|
|
|
func (c *Context) PureJSON(code int, obj interface{}) {
|
2019-04-17 17:10:21 +03:00
|
|
|
c.Render(code, render.PureJSON(obj))
|
2018-08-20 10:15:31 +03:00
|
|
|
}
|