December 2019
Intermediate to advanced
510 pages
11h 33m
English
In the previous example, we saw how to create middleware using the app.Run extension method. A key concept involved in that implementation is the HttpContext type, which is the unique entry point for obtaining all information about HTTP properties; it is usually related to the incoming request. The HttpContext attribute exposes methods and properties to get information from the request and update information in the response. The response and request information are represented by the following attributes: HttpContext.Response and HttpContext.Request. For example, in the previous case, we used the WriteAsync method, which wrote the Hello World! string in response to the current HttpContext.
Dependency injection ...