HttpRecordingOptions Class
Configuration options for the HTTP recording handler.
public sealed class HttpRecordingOptionsConstructors
| Name | Description |
|---|---|
| HttpRecordingOptions() |
HttpRecordingOptions()
HttpRecordingOptions.cspublic HttpRecordingOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| AutoSave | Gets or sets a value indicating whether recordings are saved when the handler is disposed asynchronously. Default is false. |
| MissBehavior | Gets or sets the behavior when no recorded response matches an incoming request. |
| Mode | Gets or sets the operating mode. Default is HttpRecordingMode.Auto. |
| RequestMatcher | Gets or sets the request matcher used for fingerprinting. When null, the DefaultHttpRequestMatcher is used. |
| Sanitizers | Gets the sanitizers applied to entries before persistence, and to incoming requests before matching. Empty by default, meaning no sanitization. |
AutoSave
HttpRecordingOptions.csGets or sets a value indicating whether recordings are saved when the handler is disposed asynchronously. Default is false.
public bool AutoSave { get; set; }Property value
Remarks
Auto-saving requires disposing the handler with IAsyncDisposable.DisposeAsync; a synchronous IDisposable.Dispose cannot save.
MissBehavior
HttpRecordingOptions.csGets or sets the behavior when no recorded response matches an incoming request.
public HttpRecordingMissBehavior? MissBehavior { get; set; }Property value
Remarks
When null (the default), the behavior depends on HttpRecordingOptions.Mode: HttpRecordingMissBehavior.Throw for HttpRecordingMode.Replay, and HttpRecordingMissBehavior.Passthrough for HttpRecordingMode.Auto so that a missing recording is created. Setting it explicitly overrides that default in both modes: in particular, HttpRecordingMode.Auto combined with HttpRecordingMissBehavior.Throw never performs a real HTTP call. This option is not used in HttpRecordingMode.Record.
Gets or sets the operating mode. Default is HttpRecordingMode.Auto.
public HttpRecordingMode Mode { get; set; }Property value
RequestMatcher
HttpRecordingOptions.csGets or sets the request matcher used for fingerprinting. When null, the DefaultHttpRequestMatcher is used.
public IHttpRequestMatcher? RequestMatcher { get; set; }Property value
Sanitizers
HttpRecordingOptions.csGets the sanitizers applied to entries before persistence, and to incoming requests before matching. Empty by default, meaning no sanitization.
public IList<IHttpRecordingSanitizer> Sanitizers { get; }