Stream sends a streaming response with status code and content type.
(code int, contentType string, r io.Reader)
| 648 | |
| 649 | // Stream sends a streaming response with status code and content type. |
| 650 | func (c *Context) Stream(code int, contentType string, r io.Reader) (err error) { |
| 651 | c.writeContentType(contentType) |
| 652 | c.response.WriteHeader(code) |
| 653 | _, err = io.Copy(c.response, r) |
| 654 | return |
| 655 | } |
| 656 | |
| 657 | // File sends a response with the content of the file. |
| 658 | // |