I want to create a custom http status code and want to return it with the response for specific use cases. I can not use the status codes like OK, ACCEPTED etc.
@RequestMapping(value = "/status/test", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Test> testStatus(@RequestBody Test test)
throws Exception {
// the below code is for status code 200
HttpStatus httpStatus = HttpStatus.OK;
// the above declaration declares the httpStatus with code 200 but I want to create
// a custom code like 234
return new ResponseEntity<Test>(test,httpStatus);
}