MCPcopy
hub / github.com/labstack/echo / Write

Method Write

response.go:63–76  ·  view source on GitHub ↗

Write writes the data to the connection as part of an HTTP reply.

(b []byte)

Source from the content-addressed store, hash-verified

61
62// Write writes the data to the connection as part of an HTTP reply.
63func (r *Response) Write(b []byte) (n int, err error) {
64 if !r.Committed {
65 if r.Status == 0 {
66 r.Status = http.StatusOK
67 }
68 r.WriteHeader(r.Status)
69 }
70 n, err = r.ResponseWriter.Write(b)
71 r.Size += int64(n)
72 for _, fn := range r.afterFuncs {
73 fn()
74 }
75 return
76}
77
78// Flush implements the http.Flusher interface to allow an HTTP handler to flush
79// buffered data to the client.

Callers 15

TestResponseFunction · 0.95
TestResponse_FlushFunction · 0.95
TestContextFormFileFunction · 0.45
TestContextMultipartFormFunction · 0.45
bindMultipartFilesFunction · 0.45
TestEchoWrapHandlerFunction · 0.45
jsonPBlobMethod · 0.45
JSONPBlobMethod · 0.45
xmlMethod · 0.45
XMLBlobMethod · 0.45

Calls 1

WriteHeaderMethod · 0.95

Tested by 8

TestResponseFunction · 0.76
TestResponse_FlushFunction · 0.76
TestContextFormFileFunction · 0.36
TestContextMultipartFormFunction · 0.36
bindMultipartFilesFunction · 0.36
TestEchoWrapHandlerFunction · 0.36