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

Method StatusCode

context/context.go:1468–1470  ·  view source on GitHub ↗

StatusCode sets the status code header to the response. Look .GetStatusCode & .FireStatusCode too. Note that you must set status code before write response body (except when recorder is used).

(statusCode int)

Source from the content-addressed store, hash-verified

1466//
1467// Note that you must set status code before write response body (except when recorder is used).
1468func (ctx *Context) StatusCode(statusCode int) {
1469 ctx.writer.WriteHeader(statusCode)
1470}
1471
1472// NotFound emits an error 404 to the client, using the specific custom error error handler.
1473// Note that you may need to call ctx.StopExecution() if you don't want the next handlers

Callers 8

StopWithStatusMethod · 0.95
NotFoundMethod · 0.95
WriteNotModifiedMethod · 0.95
handleContextErrorMethod · 0.95
RenderMethod · 0.95
ProblemMethod · 0.95
NegotiateMethod · 0.95
ServeFileWithRateMethod · 0.95

Calls 1

WriteHeaderMethod · 0.80

Tested by

no test coverage detected