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)
| 1466 | // |
| 1467 | // Note that you must set status code before write response body (except when recorder is used). |
| 1468 | func (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 |
no test coverage detected