Write write code and content content to response
(code int, content []byte)
| 566 | |
| 567 | // Write write code and content content to response |
| 568 | func (ctx *HttpContext) Write(code int, content []byte) (int, error) { |
| 569 | if ctx.IsHijack() { |
| 570 | // TODO:hijack mode, status-code set default 200 |
| 571 | return ctx.hijackConn.WriteBlob(content) |
| 572 | } else { |
| 573 | return ctx.response.Write(code, content) |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | // WriteString write (200, string, text/plain) to response |
| 578 | func (ctx *HttpContext) WriteString(contents ...interface{}) error { |