post发送请求,body格式
1、方法
@RequestMapping(value = "/VIID/Subscribes", method = RequestMethod.POST)
public HaiKangSubscribeRsp batchSubscribe(@RequestBody HaiKangSubscribeReq haiKangSubscribeReq) {...}
2、main方法
public static void main(String[] args) {
HaiKangSubscribeReq req = new HaiKangSubscribeReq();
HaiKangSubscribeList subscribeList = new HaiKangSubscribeList();
List<HaiKangSubscribe> subscribe = Lists.newArrayList(new HaiKangSubscribe());
subscribeList.setSubscribe(subscribe);
req.setSubscribeList(subscribeList);
System.out.println(JSONObject.toJSONString(req));
}
3、{"subscribeList":{"subscribe":[{"operateType":0,"subscribeStatus":0}]}}
根据对象 @JsonProperty("SubscribeList") 改名称 subscribeList--》 SubscribeList