Пример #1
0
 public static string Get(string method, string reqParams, bool isDocUrl = false, string url = null)
 {
     if (url == null)
     {
         url = method.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase) ? method : AppConfig.IPPort + method;
     }
     try
     {
         return(BaseHttpClient.SendRequest(RequestMode.Get, url, reqParams));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Пример #2
0
 public static string Post(string method, object obj, string url = null)
 {
     if (url == null)
     {
         url = method.StartsWith("http://", StringComparison.InvariantCultureIgnoreCase) ? method : AppConfig.IPPort + method;
     }
     try
     {
         string data = JsonHelper.ToJson(obj);
         return(BaseHttpClient.SendRequest(RequestMode.Post, url, data));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }