Class HttpExchangeResponseSnapshot
- Namespace
- XBullet.EasyTesting.Snapshots
- Assembly
- XBullet.EasyTesting.Snapshots.Core.dll
A stable representation of the response in an HTTP exchange.
public sealed record HttpExchangeResponseSnapshot : IEquatable<HttpExchangeResponseSnapshot>
- Inheritance
-
HttpExchangeResponseSnapshot
- Implements
- Inherited Members
Constructors
HttpExchangeResponseSnapshot(int, string?, IReadOnlyDictionary<string, string[]>?, object?)
A stable representation of the response in an HTTP exchange.
public HttpExchangeResponseSnapshot(int StatusCode, string? ReasonPhrase, IReadOnlyDictionary<string, string[]>? Headers, object? Body)
Parameters
StatusCodeintNumeric HTTP status code.
ReasonPhrasestringHTTP reason phrase, or null when none is supplied.
HeadersIReadOnlyDictionary<string, string[]>Captured header names and values, or null when header capture is disabled. Header names use case-insensitive comparison.
BodyobjectCaptured JSON, text, or base64 binary body, or null when body capture is disabled or the body is absent or empty.
Properties
Body
Captured JSON, text, or base64 binary body, or null when body capture is disabled or the body is absent or empty.
public object? Body { get; init; }
Property Value
BodyFailure
Gets the failure raised while the response body was recorded.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HttpExchangeFailureSnapshot? BodyFailure { get; init; }
Property Value
- HttpExchangeFailureSnapshot
The captured failure, or null when body capture completed normally.
Headers
Captured header names and values, or null when header capture is disabled. Header names use case-insensitive comparison.
public IReadOnlyDictionary<string, string[]>? Headers { get; init; }
Property Value
ReasonPhrase
HTTP reason phrase, or null when none is supplied.
public string? ReasonPhrase { get; init; }
Property Value
StatusCode
Numeric HTTP status code.
public int StatusCode { get; init; }