MCPcopy Create free account
hub / github.com/devfeel/dotweb / Write

Method Write

context.go:568–575  ·  view source on GitHub ↗

Write write code and content content to response

(code int, content []byte)

Source from the content-addressed store, hash-verified

566
567// Write write code and content content to response
568func (ctx *HttpContext) Write(code int, content []byte) (int, error) {
569 if ctx.IsHijack() {
570 // TODO:hijack mode, status-code set default 200
571 return ctx.hijackConn.WriteBlob(content)
572 } else {
573 return ctx.response.Write(code, content)
574 }
575}
576
577// WriteString write (200, string, text/plain) to response
578func (ctx *HttpContext) WriteString(contents ...interface{}) error {

Callers

nothing calls this directly

Calls 3

IsHijackMethod · 0.95
WriteBlobMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected