Write writes the data to the connection as part of an HTTP reply.
(code int, b []byte)
| 95 | |
| 96 | // Write writes the data to the connection as part of an HTTP reply. |
| 97 | func (r *Response) Write(code int, b []byte) (n int, err error) { |
| 98 | if !r.committed { |
| 99 | r.WriteHeader(code) |
| 100 | } |
| 101 | n, err = r.writer.Write(b) |
| 102 | r.Size += int64(n) |
| 103 | r.body = append(r.body, b[0:]...) |
| 104 | return |
| 105 | } |
| 106 | |
| 107 | // End stop current response |
| 108 | func (r *Response) End() { |
nothing calls this directly
no test coverage detected