AspNet 报 Microsoft.AspNetCore.Connections.ConnectionAbortedException 异常
如果在controller里面这样读取post上来的值
var ret = Request.BodyReader.ReadAsync().GetAwaiter().GetResult();
会在最终引发 Microsoft.AspNetCore.Connections.ConnectionAbortedException 异常
所以,改用这样读取:
byte[] postContent = new byte[(int)Request.ContentLength]; Request.Body.ReadAsync(postContent, 0, postContent.Length).Wait();