0
405删除方法当我通过http://localhost:8080/cerebromodel/api/skillChecklists/staff/ {4} /清单访问此功能/ {1} 我得到405Spring + Hibernate的不支持
//delete custom
@RequestMapping(value = "/remove/staff/{sid}/checklist/{cid}", method = DELETE, produces = APPLICATION_JSON_VALUE)
public ResponseEntity<Void> deleteStaffChecklist(@PathVariable Long sid,@PathVariable Long cid) throws URISyntaxException {
try {
StaffSkillChecklist ssc = staffSkillChecklistRepository.deleteStaffChecklist(sid, cid);
staffSkillChecklistRepository.delete(ssc.getId());
return ResponseEntity.ok().build();
} catch (Exception x) {
// todo: dig exception, most likely org.hibernate.exception.ConstraintViolationException
return ResponseEntity.status(HttpStatus.CONFLICT).build();
}
}
缺少什么?
也许你错误输入了它,但是你发布的URL在你的代码中没有“删除”。这肯定会导致405错误。 – Tim
谢谢你蒂姆...我的网址是不正确的..我相信我自己 – coder310