• 使用HttpRequest调用第三方接口


    下面是代码片段:

            String regResponse="";
            String sendStr="{
    " +
                    " "codeFlag": "02",
    " +
                    " "limit": 2,
    " +
                    " "page": 1,
    " +
                    " "productCode": "",
    " +
                    " "productStatus": "",
    " +
                    " "productTaskStatus": "",
    " +
                    " "productType": ""
    " +
                    "}";
            regResponse = HttpRequest.sendPost("http://10.252.68.108:32003/hmms/hmims-application/product/list", sendStr);
            System.out.println("=================="+regResponse);

    最后的返回结果:

        
    {
        "status": 0,
        "statusText": "Success",
        "data": {
            "pageNo": 1,
            "perPage": 2,
            "totalCount": 615,
            "data": [{
                "productId": "60",
                "productCode": "001",
                "productName": "至尊卡",
                "productType": "14",
                "productTypeDesc": "14-就医服务",
                "isInsurece": "N",
                "isInsureceDesc": "否",
                "insProductCode": null,
                "insProductName": null,
                "periodOption": "1",
                "periodOptionDesc": "固定期限",
                "period": "1",
                "periodUnit": "04",
                "periodUnitDesc": "年",
                "periodEndDate": null,
                "productStatus": "01",
                "productStatusDesc": "在售",
                "insProductlist": null,
                "startDate": "2016-12-22",
                "endDate": "2020-12-31",
                "saleChannel": null,
                "saleChannelDesc": null,
                "region": null,
                "isAble": "Y",
                "isAbleDesc": "是",
                "productTaskStatus": "03",
                "productTaskStatusDesc": "审批通过",
                "isDoc": "Y",
                "isDocDesc": "是",
                "price": 1580.000000,
                "costPercent": 0.000000,
                "salesCostPercent": 15.000000,
                "mntCostPercent": 5.000000,
                "taxPercent": 6.000000,
                "profitPercent": 74.000000,
                "explain": "提供北京、上海、广州地区8家知名三甲医院指定医院、指定科室副高(含)以上专家门诊预约挂号、全程陪诊、健康档案、健康咨询与指导等服务。",
                "orgCode": "86",
                "insertOper": "productadmin",
                "insertTime": "2016-12-22 19:41:03",
                "updateTime": "2018-01-02 17:58:24",
                "updateOper": "0015",
                "prepare": null,
                "isShutApply": null,
                "implType": null,
                "implTypeDesc": null,
                "psList": null,
                "saleOrgCode": null,
                "surrenderFeeRates": null,
                "productPackType": null,
                "implementationType": null,
                "delList": null,
                "isGifts": null,
                "itemType": null,
                "page": 0,
                "limit": 0
            },
            {
                "productId": "107",
                "productCode": "002",
                "productName": "畅行卡",
                "productType": "14",
                "productTypeDesc": "14-就医服务",
                "isInsurece": "N",
                "isInsureceDesc": "否",
                "insProductCode": null,
                "insProductName": null,
                "periodOption": "1",
                "periodOptionDesc": "固定期限",
                "period": "1",
                "periodUnit": "04",
                "periodUnitDesc": "年",
                "periodEndDate": null,
                "productStatus": "01",
                "productStatusDesc": "在售",
                "insProductlist": null,
                "startDate": "2016-12-22",
                "endDate": "2020-12-31",
                "saleChannel": null,
                "saleChannelDesc": null,
                "region": null,
                "isAble": "Y",
                "isAbleDesc": "是",
                "productTaskStatus": "03",
                "productTaskStatusDesc": "审批通过",
                "isDoc": "Y",
                "isDocDesc": "是",
                "price": 980.000000,
                "costPercent": 0.000000,
                "salesCostPercent": 15.000000,
                "mntCostPercent": 5.000000,
                "taxPercent": 6.000000,
                "profitPercent": 74.000000,
                "explain": "提供北京、上海、广州地区72家知名三甲医院指定医院、指定科室副高(含)以上专家门诊预约挂号、全程陪诊、健康档案、健康咨询与指导等服务。",
                "orgCode": "86",
                "insertOper": "productadmin",
                "insertTime": "2016-12-22 19:41:03",
                "updateTime": "2018-01-02 17:56:04",
                "updateOper": "0015",
                "prepare": null,
                "isShutApply": null,
                "implType": null,
                "implTypeDesc": null,
                "psList": null,
                "saleOrgCode": null,
                "surrenderFeeRates": null,
                "productPackType": null,
                "implementationType": null,
                "delList": null,
                "isGifts": null,
                "itemType": null,
                "page": 0,
                "limit": 0
            }]
        }
    }

    这个路径使用postman也是可以的:

  • 相关阅读:
    Hibernate关于字段的属性设计
    Hibernate之增删查改常见错误
    Hibernate之实体类设计基本步骤
    Github开源之旅第二季-MarkDown
    8.Git命令(上)
    9.Git命令(下)
    7.Git Bash操作的四个坑(基本LINUX操作)
    Webserver-HTTP项目(深入理解HTTP协议)
    JAVA入门到精通-第94讲-山寨QQ项目8-好友在线提示
    JAVA入门到精通-第93讲-山寨QQ项目7-好友在线提示
  • 原文地址:https://www.cnblogs.com/dongyaotou/p/13098104.html
Copyright © 2020-2023  润新知