static void SignTest() { string ss = ""; string url = Cfg.Get("url"); string channelId = Cfg.Get("channelId"); string privateKey = Cfg.Get("privateKey"); string publicKey = Cfg.Get("publicKey"); string charset = "UTF-8"; ZZXClient zzxclient = new ZZXClient(url, channelId, privateKey, publicKey, charset); ZZXApiRequest request = new ZZXApiRequest(); request.Method = "loanApply ";//设置接口 var tt = new { id = "123" }; request.Params = JsonConvert.SerializeObject(tt); //ZZXResponse response = client.Execute(request); var dic = zzxclient.getSystemParams(request);//参数 //var parms = WebUtils.BuildQuery(dic, charset);//组装成参数 ////直接序列化 ////var parms= var sign = dic["sign"].ToString(); //dic.Add("sign", sign); //JsonConvert.SerializeObject(dic); //var d = dic.OrderBy(p => p.Key).ToDictionary(p => p.Key, o => o.Value); //移除sign 试试 //dic.Remove("sign"); var parms = JsonConvert.SerializeObject(dic); //using (HttpClient client = new HttpClient()) //{ // IEnumerable<KeyValuePair<string, string>> queryPart = new List<KeyValuePair<string, string>>(){ // new KeyValuePair<string, string>("params",parms), // new KeyValuePair<string, string>("sign",sign) // }; // HttpContent q = new FormUrlEncodedContent(queryPart); // //url = baseurl + url; // using (HttpResponseMessage response = client.PostAsync("https://ssl-scf.xingyoucai.com/api/v1/antai/checkSign.do", q).Result) // { // using (HttpContent content = response.Content) // { // var html = content.ReadAsStringAsync().Result; // Console.WriteLine(html); // } // } //} HttpClient client = new HttpClient(); var t = client.GetAsync("https://ssl-scf.xingyoucai.com/api/v1/antai/checkSign.do?params=" + parms + "&sign=" + sign).Result; //var body = JsonConvert.SerializeObject(dic); //var result = RequestHelper.HttpPost("https://ssl-scf.xingyoucai.com/api/v1/antai/checkSign.do", body: body); Console.WriteLine(t); }