ClientHandler Class

This adapts HttpRequestMessages to ASP.NET Core requests, dispatches them through the pipeline, and returns the associated HttpResponseMessage.

Namespace
Microsoft.AspNetCore.TestHost
Assemblies
  • Microsoft.AspNetCore.TestHost

Inheritance Hierarchy

Syntax

public class ClientHandler : HttpMessageHandler, IDisposable
class Microsoft.AspNetCore.TestHost.ClientHandler

Constructors

ClientHandler(Microsoft.AspNetCore.Http.PathString, Microsoft.AspNetCore.Hosting.Server.IHttpApplication<Microsoft.AspNetCore.Hosting.Internal.HostingApplication.Context>)

Create a new handler.

Arguments:
public ClientHandler(PathString pathBase, IHttpApplication<HostingApplication.Context> application)

Methods

SendAsync(System.Net.Http.HttpRequestMessage, System.Threading.CancellationToken)

This adapts HttpRequestMessages to ASP.NET Core requests, dispatches them through the pipeline, and returns the associated HttpResponseMessage.

Return type:System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)