如何从邮递员处为自定义VO发送JSON
我应该从Postman发送什么格式的JSON,以便将其正确映射到我的rest控制器如何从邮递员处为自定义VO发送JSON,json,spring,get,postman,spring-restcontroller,Json,Spring,Get,Postman,Spring Restcontroller,我应该从Postman发送什么格式的JSON,以便将其正确映射到我的rest控制器 TfundsVO : BigDecimal accountNum String accountName BigDecimal accountBal @GetMapping("/") public ResponseEntity<Object> getFunds(@RequestBody TfundsVO tfundsVO) { System.out.println(tfundsVO.get
TfundsVO :
BigDecimal accountNum
String accountName
BigDecimal accountBal
@GetMapping("/")
public ResponseEntity<Object> getFunds(@RequestBody TfundsVO tfundsVO) {
System.out.println(tfundsVO.getAccountNum());
}
当我从Postman尝试上面的JSON时,调用了getFunds方法,但是TfundsVO中的所有值都是空的。只发送不带数组的有效负载
{ "account name": "test" }
请添加一个application/json头作为内容类型
{ "account name": "test" }