Class HttpRoutingDispatcher
- Namespace
- System.Web.Http.Dispatcher
- Assembly
- System.Web.Http.dll
This class is the default endpoint message handler which examines the IHttpRoute of the matched route, and chooses which message handler to call. If Handler is null, then it delegates to HttpControllerDispatcher.
public class HttpRoutingDispatcher : HttpMessageHandler, IDisposable
- Inheritance
-
HttpRoutingDispatcher
- Implements
- Inherited Members
Constructors
HttpRoutingDispatcher(HttpConfiguration)
Initializes a new instance of the HttpRoutingDispatcher class, using the provided HttpConfiguration and HttpControllerDispatcher as the default handler.
public HttpRoutingDispatcher(HttpConfiguration configuration)
Parameters
configuration
HttpConfigurationThe server configuration.
HttpRoutingDispatcher(HttpConfiguration, HttpMessageHandler)
Initializes a new instance of the HttpRoutingDispatcher class, using the provided HttpConfiguration and HttpMessageHandler.
public HttpRoutingDispatcher(HttpConfiguration configuration, HttpMessageHandler defaultHandler)
Parameters
configuration
HttpConfigurationThe server configuration.
defaultHandler
HttpMessageHandlerThe default handler to use when the IHttpRoute has no Handler.
Methods
SendAsync(HttpRequestMessage, CancellationToken)
Sends an HTTP request as an asynchronous operation.
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
request
HttpRequestMessageThe HTTP request message to send.
cancellationToken
CancellationTokenThe cancellation token to cancel operation.
Returns
- Task<HttpResponseMessage>
The task object representing the asynchronous operation.