[HttpPost("WxNotify")]
public async Task WxNotify()
{
HttpContextAccessor context = new();
var request = context.HttpContext?.Request;
if (request != null)
{
var buffer = new MemoryStream();
await request.Body.CopyToAsync(buffer);
var notify = Encoding.UTF8.GetString(buffer.GetBuffer());
//todo:解析notify
await Response.Body.WriteAsync(Encoding.UTF8.GetBytes("SUCCESS"));
}
}
标签:WebAPI,Body,buffer,微信,request,notify,var,NET
From: https://www.cnblogs.com/fanggm/p/17865140.html