コード例 #1
0
ファイル: TopClientDefault.cs プロジェクト: yuzhupeng/UPS.SDK
        public string ExecuteUrl(string ApiUrl, IDictionary <string, string> parameters)
        {
            string result = string.Empty;

            try
            {
                SDKUtils sdk = new SDKUtils();
                result = sdk.DoPost(ApiUrl, parameters);
            }
            catch (Exception e)
            {
                DataResult dataResult = new DataResult()
                {
                    Code = (int)EResponseCode.Exception, Message = e.Message
                };
                result = JsonHelper.SerializeObject(dataResult);
            }
            return(result);
        }
コード例 #2
0
ファイル: TopClientDefault.cs プロジェクト: yuzhupeng/UPS.SDK
        public string Execute(string ApiName, IDictionary <string, string> parameters)
        {
            string result = string.Empty;

            try
            {
                string   UPS_URL_RATE = ConfigurationManager.AppSettings["UPS_URL_RATE"];
                SDKUtils sdk          = new SDKUtils();
                string   ApiUrl       = string.Format("{0}{1}", UPS_URL_RATE, ApiName);
                result = sdk.DoPost(ApiUrl, parameters);
            }
            catch (Exception e)
            {
                DataResult dataResult = new DataResult()
                {
                    Code = (int)EResponseCode.Exception, Message = e.Message
                };
                result = JsonHelper.SerializeObject(dataResult);
            }
            return(result);
        }