Can we create custom HTTP Status codes ?
黄舟2017-04-18 10:36:24
Ofcourse, you can use raw servlet api HttpServletResponse,
@RequestMapping("test")
public void test(HttpServletResponse response) throws IOException {
response.setStatus(10000); // http status code 10000(NOT EXISTS)
response.flushBuffer();
}
But is's not recommend to use a HTTP status code that does not exists,
cause the clients don't know what it means