post请求改成body_post发送请求,body格式

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 16:08   2115   0

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 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

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP