zoukankan      html  css  js  c++  java
  • 初识ASP.NET CORE:三、Middleware

    Middleware are simpler than HTTP modules and handlers:
    Modules, handlers, Global.asax.cs, Web.config (except for IIS configuration) and the application life cycle are gone
    The roles of both modules and handlers have been taken over by middleware
    Middleware are configured using code rather than in Web.config
    Pipeline branching lets you send requests to specific middleware, based on not only the URL but also on request headers, query strings, etc.
    Middleware are very similar to modules:
    Invoked in principle for every request
    Able to short-circuit a request, by not passing the request to the next middleware
    Able to create their own HTTP response
    Middleware and modules are processed in a different order:
    Order of middleware is based on the order in which they are inserted into the request pipeline, while order of modules is mainly based on application life cycle events
    Order of middleware for responses is the reverse from that for requests, while order of modules is the same for requests and responses
    See Creating a middleware pipeline with IApplicationBuilder

    Each delegate has the opportunity to perform operations before and after the next delegate.Any delegate can choose to stop passing the request on to the next delegate, and instead handle the request itself. This is referred to as short-circuiting the request pipeline, and is desirable because it allows unnecessary work to be avoided.

  • 相关阅读:
    hdu1879 继续畅通工程
    hdu1875 畅通工程再续 最小生成树并查集解决---kruskal
    hdu1863 畅通工程2 还是用并查集思想解决最小生成树问题
    hud2544dijkstra+堆优化
    PHP holiday1
    记忆化搜索hdu1078 dfs
    hdu 1548 楼梯 bfs或最短路 dijkstra
    隐藏原生html5 video controls
    工具网站gallery
    判断节点包含
  • 原文地址:https://www.cnblogs.com/riusmary/p/5757503.html
Copyright © 2011-2022 走看看