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

StatusCode int

Numeric HTTP status code.

ReasonPhrase string

HTTP reason phrase, or null when none is supplied.

Headers IReadOnlyDictionary<string, string[]>

Captured header names and values, or null when header capture is disabled. Header names use case-insensitive comparison.

Body object

Captured 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

object

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

IReadOnlyDictionary<string, string[]>

ReasonPhrase

HTTP reason phrase, or null when none is supplied.

public string? ReasonPhrase { get; init; }

Property Value

string

StatusCode

Numeric HTTP status code.

public int StatusCode { get; init; }

Property Value

int