|
@ -11,7 +11,7 @@ namespace NFine.Data.Extensions |
|
|
{ |
|
|
{ |
|
|
public class HTTPHelper |
|
|
public class HTTPHelper |
|
|
{ |
|
|
{ |
|
|
private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
|
|
|
|
|
|
|
|
//private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
|
|
|
|
|
public static string HttpPost(string apiName, string url, string body) |
|
|
public static string HttpPost(string apiName, string url, string body) |
|
|
{ |
|
|
{ |
|
@ -35,7 +35,7 @@ namespace NFine.Data.Extensions |
|
|
} |
|
|
} |
|
|
catch (System.Net.WebException ex) |
|
|
catch (System.Net.WebException ex) |
|
|
{ |
|
|
{ |
|
|
log.Error(ex.ToString() + Environment.NewLine + url + Environment.NewLine + body); |
|
|
|
|
|
|
|
|
//log.Error(ex.ToString() + Environment.NewLine + url + Environment.NewLine + body);
|
|
|
throw new Exception(apiName + "调用失败," + ex.Message); |
|
|
throw new Exception(apiName + "调用失败," + ex.Message); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|