SDK

一、曹操开放平台SDK

为了提高对接效率,曹操提供各种语言简单SDK,方便接入方的对接。

JAVA语言: java-sdk

JAVA示例

    //Java示例
    public class CaoJavaSdkDemo {
        static String copUrl = "https://sandbox-cop.caocaokeji.cn";
        static String clientId = "38629e67773503a8";
        static String signKey = "a4d6d8bdadec33c7ab46df69beace8c1";

        public static void main(String[] args) {
            String estimateUrl = copUrl + "/v2/common/queryMeterRuleV2";
            Map<String,String> params = new HashMap<>();
            params.put( "car_type", "2");
            params.put( "order_type", "1");
            params.put( "city_code", "0571");
            CaocaoClient client = new DefaultCaoCaoClient( clientId,signKey,estimateUrl, SignatureAlgorithm.SHA1);
            HttpResponse result = client.execute( params,HttpMethod.METHOD_GET );
            if(null != result && result.isSuccess()){
                System.out.println(JSON.toJSONString(params) );
            }
        }
    }