对于Postman或其他没有Content-Type集的调用,在Spring中设置方法签名的必要条件是什么?调用未设置内容类型的Spring端点
的签名是:
@RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public ResponseEntity getHouseholdChanges (@PathVariable("id") Long id) { ... }
当我叫邮差没有Content-Type的我收到415个状态。
我需要从别人的电话,当我不能设置内容类型,但始终是相同的这种方法。
我无法用spring-boot 1.5.6.RELEASE重现此问题。你正在运行什么版本的弹簧引导? –
春天版本:4.3.0.RC2和春季启动版本:1.4.0.M3 –