每个网页都说这行代码
return new ResponseEntity<Customer>(HttpStatus.BAD_REQUEST);
返回错误代码400,但是当我强制执行该操作时,我得到“ 405 Method Not Allowed”。 为什么?
@PutMapping(value = "/rest/customer/{id}")
public Object updateCustomer(@PathVariable(name = "id") long id,
@RequestBody Customer customer) {
if (id != customer.getId()) {
return new ResponseEntity<Customer>(HttpStatus.BAD_REQUEST);
} else {