Class CapturingHttpClientHandler
A HttpMessageHandler that retrieves http response messages from from the http endpoint and then stores them for future retrieval
Inherited Members
System.Net.Http.HttpClientHandler.CheckCertificateRevocationList
System.Net.Http.HttpClientHandler.ClientCertificates
System.Net.Http.HttpClientHandler.DefaultProxyCredentials
System.Net.Http.HttpClientHandler.MaxConnectionsPerServer
System.Net.Http.HttpClientHandler.MaxResponseHeadersLength
System.Net.Http.HttpClientHandler.Properties
System.Net.Http.HttpClientHandler.ServerCertificateCustomValidationCallback
System.Net.Http.HttpClientHandler.SslProtocols
Namespace: FakeHttp
Assembly: FakeHttp.dll
Syntax
public sealed class CapturingHttpClientHandler : HttpClientHandler, IDisposable
Constructors
| Improve this Doc View SourceCapturingHttpClientHandler(IResources)
Declaration
public CapturingHttpClientHandler(IResources resources)
Parameters
Type | Name | Description |
---|---|---|
IResources | resources | An object that can access stored response |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
CapturingHttpClientHandler(IResponseStore)
ctor
Declaration
public CapturingHttpClientHandler(IResponseStore store)
Parameters
Type | Name | Description |
---|---|---|
IResponseStore | store | The storage mechanism for responses |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
Methods
| Improve this Doc View SourceSendAsync(HttpRequestMessage, CancellationToken)
Override the base class to capture and store the response message
Declaration
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestMessage | request | The HttpRequestMessage to capture and store |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | The stored response message |