我们正在使用 Web API 2,为了处理异常,我们通过继承 ExceptionFilterAttribute 创建了一个自定义属性。现在我们想将 JSON 请求的日志保存到数据库中以防万一。
我尝试使用 context.Request.Content.ReadAsStringAsync().Result 读取但它返回空字符串。
请帮忙!!
c# httpcontext asp.net-web-api2
asp.net-web-api2 ×1
c# ×1
httpcontext ×1