mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-02-04 01:11:10 +08:00
Compare commits
No commits in common. "e10c20c5d6fb81078d994f26dfd8872ff78a467d" and "583609945e3efbe0e100e63ef42985bb884167d1" have entirely different histories.
e10c20c5d6
...
583609945e
1 changed files with 0 additions and 7 deletions
|
|
@ -271,13 +271,6 @@ func (c *Context) String(code int, format string, values ...interface{}) {
|
||||||
c.Writer.Write([]byte(fmt.Sprintf(format, values...)))
|
c.Writer.Write([]byte(fmt.Sprintf(format, values...)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Text 向响应写入无需格式化的string
|
|
||||||
func (c *Context) Text(code int, text string) {
|
|
||||||
c.Writer.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
|
||||||
c.Writer.WriteHeader(code)
|
|
||||||
c.Writer.Write([]byte(text))
|
|
||||||
}
|
|
||||||
|
|
||||||
// JSON 向响应写入 JSON 数据
|
// JSON 向响应写入 JSON 数据
|
||||||
// 设置 Content-Type 为 application/json
|
// 设置 Content-Type 为 application/json
|
||||||
func (c *Context) JSON(code int, obj interface{}) {
|
func (c *Context) JSON(code int, obj interface{}) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue