private SortedDictionary <String, String> GetRequestParam(SimbossRequest request) { SortedDictionary <String, String> paramDic = request.GetParam(); paramDic.Add("appid", this.config.AppId); paramDic.Add("timestamp", TimeHelper.GetTimeStamp()); String sign = SignatureHelper.GetSignature(paramDic, this.config.AppSecret); paramDic.Add("sign", sign); return(paramDic); }
public SimbossResponse <T> Excute <T>(SimbossRequest request) { SimbossResponse <T> response; String result = null; try { String url = this.config.ApiUrl + request.GetUri(); SortedDictionary <String, String> paramDic = GetRequestParam(request); Task <String> task = Post(url, paramDic); result = task.Result; response = JsonConvert.DeserializeObject <SimbossResponse <T> >(result); } catch (System.Exception e) { response = new SimbossResponse <T>(); response.Success = false; response.Message = e.Message + ", result: " + result; response.Code = "599"; } return(response); }