예제 #1
0
        public void Init_accessToken()
        {
            MyHttpClient a = MyHttpClient.getInstance(path_dir + "outgoing.CertwithKey.pkcs12", "IoM@1234", path_dir + "ca.jks", "Huawei@123");

            Map paramLogin = new HashMap();

            paramLogin.put("appId", appId);
            paramLogin.put("secret", secret);

            ResponseMsg b = a.sendMsg(url_login, paramLogin);
            HttpsUtil   http_utils_test = new HttpsUtil();

            string login_str = b.getContent().ToString();

            System.Diagnostics.Debug.WriteLine(login_str);
            accessToken_str = extract_data_from_json(login_str, "\"accessToken\"", 0).Replace("\"", "");//删除双引号,这里获取的accessToken以后会用到
            System.Diagnostics.Debug.WriteLine(accessToken_str);
        }