Class AutomaticHttpClientHandler
A HttpMessageHandler that retrieves http response messages from from local storage if they exist or if they do not, 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 AutomaticHttpClientHandler : HttpClientHandler, IDisposable
Constructors
| Improve this Doc View SourceAutomaticHttpClientHandler(IResources)
Declaration
public AutomaticHttpClientHandler(IResources resources)
Parameters
Type | Name | Description |
---|---|---|
IResources | resources | An object that can access stored response |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
AutomaticHttpClientHandler(IResponseStore)
ctor
Declaration
public AutomaticHttpClientHandler(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 if it doesn't already exist in storage
Declaration
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestMessage | request | The HttpRequestMessage to find or retreive from the endpoint |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | The response message |