Write Adds the contents to the body reply, it writes the contents temporarily to a value in order to be flushed at the end of the request, this method give us the opportunity to reset the body if needed. If WriteHeader has not yet been called, Write calls WriteHeader(http.StatusOK) before writing t
(contents []byte)
| 90 | // by all HTTP/2 clients. Handlers should read before writing if |
| 91 | // possible to maximize compatibility. |
| 92 | func (w *ResponseRecorder) Write(contents []byte) (int, error) { |
| 93 | w.chunks = append(w.chunks, contents...) |
| 94 | // Remember that we should not return all the written length within `Write`: |
| 95 | // see https://github.com/kataras/iris/pull/931 |
| 96 | return len(contents), nil |
| 97 | } |
| 98 | |
| 99 | // Header returns the temporary header map that, on flush response, |
| 100 | // will be sent by the underline's ResponseWriter's WriteHeader method. |
no outgoing calls
no test coverage detected