zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    成熟失去快乐
    明天出发
    不知其期
    不是自己的机子就是不好
    都收拾完了
    文盲
    郁闷
    好像感冒了
    又都疯了
    流水账,从我开始接触计算机时写起
  • 原文地址:https://www.cnblogs.com/acme6/p/11344103.html
Copyright © 2011-2022 走看看