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

Method WriteHeader

context/response_writer.go:236–238  ·  view source on GitHub ↗

WriteHeader sends an HTTP response header with status code. If WriteHeader is not called explicitly, the first call to Write will trigger an implicit WriteHeader(http.StatusOK). Thus explicit calls to WriteHeader are mainly used to send error codes.

(statusCode int)

Source from the content-addressed store, hash-verified

234// Thus explicit calls to WriteHeader are mainly used to
235// send error codes.
236func (w *responseWriter) WriteHeader(statusCode int) {
237 w.statusCode = statusCode
238}
239
240func (w *responseWriter) tryWriteHeader() {
241 if w.written == NoWritten { // before write, once.

Callers 11

mainFunction · 0.80
irisRavenMiddlewareFunction · 0.80
RedirectAbsoluteFunction · 0.80
FireErrorCodeMethod · 0.80
TestFromStdWithNextFunction · 0.80
tryWriteHeaderMethod · 0.80
CopyToMethod · 0.80
ResetMethod · 0.80
CopyToMethod · 0.80
StatusCodeMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestFromStdWithNextFunction · 0.64