WriteBlobC write (httpCode, []byte) to response
(code int, contentType string, b []byte)
| 603 | |
| 604 | // WriteBlobC write (httpCode, []byte) to response |
| 605 | func (ctx *HttpContext) WriteBlobC(code int, contentType string, b []byte) error { |
| 606 | if contentType != "" { |
| 607 | ctx.response.SetContentType(contentType) |
| 608 | } |
| 609 | if ctx.IsHijack() { |
| 610 | _, err := ctx.hijackConn.WriteBlob(b) |
| 611 | return err |
| 612 | } else { |
| 613 | _, err := ctx.response.Write(code, b) |
| 614 | return err |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | // WriteJson write (httpCode, json string) to response |
| 619 | // auto convert interface{} to json string |
no test coverage detected