mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 01:57:55 +08:00
32 lines
692 B
Go
32 lines
692 B
Go
// Copyright 2014 Manu Martinez-Almeida. 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 (
|
|
"errors"
|
|
"io"
|
|
"io/ioutil"
|
|
"math"
|
|
"mime/multipart"
|
|
"net"
|
|
"net/http"
|
|
"net/url"
|
|
"os"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/gin-contrib/sse"
|
|
"github.com/gin-gonic/gin/binding"
|
|
"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{}) {
|
|
c.Render(code, render.PureJSON{Data: obj})
|
|
}
|