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

Method Write

context/response_writer.go:274–279  ·  view source on GitHub ↗

Write writes to the client If WriteHeader has not yet been called, Write calls WriteHeader(http.StatusOK) before writing the data. If the Header does not contain a Content-Type line, Write adds a Content-Type set to the result of passing the initial 512 bytes of written data to DetectContentType. D

(contents []byte)

Source from the content-addressed store, hash-verified

272// by all HTTP/2 clients. Handlers should read before writing if
273// possible to maximize compatibility.
274func (w *responseWriter) Write(contents []byte) (int, error) {
275 w.tryWriteHeader()
276 n, err := w.ResponseWriter.Write(contents)
277 w.written += n
278 return n, err
279}
280
281// StatusCode returns the status code header value
282func (w *responseWriter) StatusCode() int {

Callers 1

IsHijackedMethod · 0.45

Calls 1

tryWriteHeaderMethod · 0.95

Tested by

no test coverage detected