我在发布消息时遇到以下异常。不知道为什么会这样。有数据点吗?
将内容复制到流时出错
var client = new HttpClient(new HttpClientHandler()
{
UseDefaultCredentials = true
});
client.BaseAddress = new Uri(Convert.ToString(ConfigurationManager.AppSettings["ServiceMethodUrl"]));
var javaScriptSerializer = new System.Web.Script.Serialization.JavaScriptSerializer();
string jsonString = javaScriptSerializer.Serialize(payload);
var httpContent = new StringContent(jsonString, Encoding.UTF8, "application/JSON");
HttpResponseMessage response=client.PostAsync("api/event/PostEventStatus", httpContent).Result;
return response.StatusCode;