For creating custom middleware, the delegate needs to accept a _________ and return a Task.

  • HttpContext
  • HttpRequest
  • HttpResponse
  • CancellationToken
For creating custom middleware in ASP.NET Core, the delegate used in the middleware pipeline should accept an HttpRequest and return a Task. Middleware operates on the incoming request, and by convention, it often manipulates the request and response. Therefore, it takes an HttpRequest as input. The Task return type allows asynchronous operations to be performed in the middleware.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *