MCPcopy Create free account
hub / github.com/kataras/iris / Write

Method Write

context/response_recorder.go:92–97  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

90// by all HTTP/2 clients. Handlers should read before writing if
91// possible to maximize compatibility.
92func (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.

Callers 3

FlushResponseMethod · 0.45
CopyToMethod · 0.45
FlushMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected