Feature interfaces define specific HTTP features that a given request may support. Servers define collections of features,and the initial set of features supported by that server,but middleware can be used to enhance these features.
我最初的理解是,请求功能是服务器应该公开的所有内容,以便在应用程序管道上使用.也就是说,服务器应该执行的行为,如发送文件.
另一方面,例如,存在认证请求特征.现在,我不确定身份验证属于这一类.它似乎不是应用程序应该调用的某些服务器行为,而是应用程序本身的一个问题.
这让我想知道什么才能真正成为一个请求功能.那么,什么使得某些东西成为ASP.NET Core中的请求功能?我最初的理解是错的吗?做出请求功能的决定背后是什么?
解决方法
My initial understanding about this was that request features are all things a server should expose to be used on the application pipeline. That is,behaviors that a server should perform like sending a file.
这是http功能的一种用法.它也是一种增强或点亮HttpContext行为的方法,如缓冲,发送文件,身份验证,websockets.
>异常处理程序中间件流动通过请求功能发生的异常 – https://github.com/aspnet/Diagnostics/blob/dev/src/Microsoft.AspNetCore.Diagnostics.Abstractions/IExceptionHandlerFeature.cs.
>路由中间件通过请求功能将路由数据添加到当前http上下文 – https://github.com/aspnet/Routing/blob/dev/src/Microsoft.AspNetCore.Routing.Abstractions/IRoutingFeature.cs
通常,它是一种从服务器,中间件到应用程序的每个请求行为和状态的流动方式.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。