ASP.NET CoreでBodyエントリを読み込む
#region body
//
Request.EnableBuffering();
var postJson = "";
var stream = Request.HttpContext.Request.Body;
long? length = Request.HttpContext.Request.ContentLength;
if (length != null && length > 0)
{
// ,
StreamReader streamReader = new StreamReader(stream, Encoding.UTF8);
postJson = streamReader.ReadToEndAsync().Result;
}
Request.HttpContext.Request.Body.Position = 0;
#endregion