6

I am getting the exception below while posting message .Not sure why does this come. Any data points?

Error while copying content to a stream

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;
marcramser
  • 579
  • 1
  • 10
  • 23
CoolDiva
  • 209
  • 1
  • 3
  • 14

0 Answers0