Error sets response status code to the given value and sets response body to the given message. Warning: this will reset the response headers and body already set!
(msg string, statusCode int)
| 1403 | // |
| 1404 | // Warning: this will reset the response headers and body already set! |
| 1405 | func (ctx *RequestCtx) Error(msg string, statusCode int) { |
| 1406 | ctx.Response.Reset() |
| 1407 | ctx.SetStatusCode(statusCode) |
| 1408 | ctx.SetContentTypeBytes(defaultContentType) |
| 1409 | ctx.SetBodyString(msg) |
| 1410 | } |
| 1411 | |
| 1412 | // Success sets response Content-Type and body to the given values. |
| 1413 | func (ctx *RequestCtx) Success(contentType string, body []byte) { |
no test coverage detected