agv
This commit is contained in:
@@ -34,8 +34,15 @@ namespace Infrastructure
|
||||
using HttpContent httpContent = new StringContent(postData, Encoding.UTF8);
|
||||
if (contentType != null)
|
||||
httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(contentType);
|
||||
|
||||
HttpResponseMessage response = client.PostAsync(url, httpContent).Result;
|
||||
HttpResponseMessage response = null;
|
||||
try
|
||||
{
|
||||
response = client.PostAsync(url, httpContent).Result;
|
||||
}catch (Exception ex)
|
||||
{
|
||||
return "异常:"+ex.Message;
|
||||
}
|
||||
|
||||
return response.Content.ReadAsStringAsync().Result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user