Class HttpExchangeResponseSnapshotOptions
- Namespace
- XBullet.EasyTesting.Snapshots
- Assembly
- XBullet.EasyTesting.Snapshots.Core.dll
Controls which HTTP response details are included in an exchange snapshot.
public sealed class HttpExchangeResponseSnapshotOptions
- Inheritance
-
HttpExchangeResponseSnapshotOptions
- Inherited Members
Properties
IgnoredHeaders
Gets response headers excluded from snapshots.
public ISet<string> IgnoredHeaders { get; }
Property Value
IncludeBody
Gets or sets whether response content is included.
public bool IncludeBody { get; set; }
Property Value
IncludeHeaders
Gets or sets whether response headers are included.
public bool IncludeHeaders { get; set; }
Property Value
RedactedHeaders
Gets response headers whose values are replaced with {Redacted}.
public ISet<string> RedactedHeaders { get; }
Property Value
Methods
IgnoringHeaders(params string[])
Excludes response headers and returns this instance.
public HttpExchangeResponseSnapshotOptions IgnoringHeaders(params string[] headerNames)
Parameters
headerNamesstring[]A non-null array of non-empty names, matched case-insensitively.
Returns
- HttpExchangeResponseSnapshotOptions
This options instance, for chaining. Exclusion removes any redaction decision.
IncludingHeader(string)
Includes a response header that was excluded by default.
public HttpExchangeResponseSnapshotOptions IncludingHeader(string headerName)
Parameters
headerNamestringThe non-empty case-insensitive name to include with original values.
Returns
- HttpExchangeResponseSnapshotOptions
This options instance, for chaining, clearing ignore and redaction decisions.
RedactingHeader(string)
Redacts a response header value while preserving the header.
public HttpExchangeResponseSnapshotOptions RedactingHeader(string headerName)
Parameters
headerNamestringThe non-empty case-insensitive name to preserve with a redacted value.
Returns
- HttpExchangeResponseSnapshotOptions
This options instance, for chaining.
RedactingHeaders(params string[])
Redacts response header values while preserving the headers.
public HttpExchangeResponseSnapshotOptions RedactingHeaders(params string[] headerNames)
Parameters
headerNamesstring[]A non-null array of non-empty names, matched case-insensitively.
Returns
- HttpExchangeResponseSnapshotOptions
This options instance, for chaining, removing those names from ignored headers.
WithoutBody()
Excludes response content and returns this instance.
public HttpExchangeResponseSnapshotOptions WithoutBody()
Returns
- HttpExchangeResponseSnapshotOptions
This options instance, for chaining.
WithoutHeaders()
Excludes response headers and returns this instance.
public HttpExchangeResponseSnapshotOptions WithoutHeaders()
Returns
- HttpExchangeResponseSnapshotOptions
This options instance, for chaining.