HttpRecordingOptions Class

Configuration options for the HTTP recording handler.

public sealed class HttpRecordingOptions

Constructors

NameDescription
HttpRecordingOptions()

HttpRecordingOptions()

HttpRecordingOptions.cs
public HttpRecordingOptions()

No documentation is available.

Properties

NameDescription
AutoSaveGets or sets a value indicating whether recordings are saved when the handler is disposed asynchronously. Default is false.
MissBehaviorGets or sets the behavior when no recorded response matches an incoming request.
ModeGets or sets the operating mode. Default is HttpRecordingMode.Auto.
RequestMatcherGets or sets the request matcher used for fingerprinting. When null, the DefaultHttpRequestMatcher is used.
SanitizersGets the sanitizers applied to entries before persistence, and to incoming requests before matching. Empty by default, meaning no sanitization.

Gets 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

bool

Remarks

Auto-saving requires disposing the handler with IAsyncDisposable.DisposeAsync; a synchronous IDisposable.Dispose cannot save.

Gets or sets the behavior when no recorded response matches an incoming request.

public HttpRecordingMissBehavior? MissBehavior { get; set; }

Property value

HttpRecordingMissBehavior?

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

HttpRecordingMode

Gets or sets the request matcher used for fingerprinting. When null, the DefaultHttpRequestMatcher is used.

public IHttpRequestMatcher? RequestMatcher { get; set; }

Property value

IHttpRequestMatcher?

Gets the sanitizers applied to entries before persistence, and to incoming requests before matching. Empty by default, meaning no sanitization.

public IList<IHttpRecordingSanitizer> Sanitizers { get; }