提交代码
This commit is contained in:
@ -278,11 +278,11 @@ namespace 货架标准上位机.Api
|
||||
try
|
||||
{
|
||||
if (isSaveLog)
|
||||
Logs.Write($"【{guid}】开始请求调用接口 url:{url} 请求方式:{httpMethod} 数据:{data}");
|
||||
Logs.Write($"【{guid}】开始请求调用接口 url:{url} 请求方式:{httpMethod} 数据:{data}",LogsType.Api);
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.Method = httpMethod;
|
||||
request.ContentType = "application/json";
|
||||
request.Timeout = 100000;
|
||||
request.Timeout = 10000;
|
||||
|
||||
if (!string.IsNullOrEmpty(data))
|
||||
{
|
||||
@ -303,7 +303,7 @@ namespace 货架标准上位机.Api
|
||||
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding));
|
||||
string retString = reader.ReadToEnd();
|
||||
if (isSaveLog)
|
||||
Logs.Write($"【{guid}】请求调用接口结束 返回数据为{retString}");
|
||||
Logs.Write($"【{guid}】请求调用接口结束 返回数据为{retString}", LogsType.Api);
|
||||
return JsonConvert.DeserializeObject<T>(retString);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
Reference in New Issue
Block a user