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

posted @ 2019-08-13 09:57  极致网络科技  阅读(1412)  评论(0编辑  收藏  举报