【发布时间】:2019-11-28 02:18:29
【问题描述】:
我应该从 Postman 发送什么格式的 JSON 以将其正确映射到我的休息控制器。
TfundsVO :
BigDecimal accountNum
String accountName
BigDecimal accountBal
@GetMapping("/")
public ResponseEntity<Object> getFunds(@RequestBody TfundsVO tfundsVO) {
System.out.println(tfundsVO.getAccountNum());
}
使用的示例 JSON:
{
"tfundsVO": [
{
"accountName": "Sam"
}
]
}
当我从 Postman 尝试上述 JSON 时,调用转到 getFunds 方法,但是 TfundsVO 中的所有值都是 NULL。
【问题讨论】:
标签: json spring get postman spring-restcontroller