Class StubHttpResponse

Namespace
XBullet.EasyTesting.Http
Assembly
XBullet.EasyTesting.Http.dll

A captured outbound HTTP response.

public sealed record StubHttpResponse : IEquatable<StubHttpResponse>
Inheritance
StubHttpResponse
Implements
Inherited Members

Constructors

StubHttpResponse(int, string?, IReadOnlyDictionary<string, string[]>, bool, ReadOnlyMemory<byte>, StubHttpFailure?)

A captured outbound HTTP response.

public StubHttpResponse(int StatusCode, string? ReasonPhrase, IReadOnlyDictionary<string, string[]> Headers, bool BodyCaptured, ReadOnlyMemory<byte> Body, StubHttpFailure? BodyFailure)

Parameters

StatusCode int

The numeric HTTP status code returned by the stub.

ReasonPhrase string

The optional HTTP reason phrase, or null when none was supplied.

Headers IReadOnlyDictionary<string, string[]>

A case-insensitive snapshot of response and content headers. The exchange owns the dictionary and nested arrays; callers must not mutate them.

BodyCaptured bool

true when the response has no content or content consumption has completed or failed; otherwise, false.

Body ReadOnlyMemory<byte>

The response bytes captured during content consumption. Before consumption this is empty; after a failed read it contains the bytes written before failure. The exchange owns the memory.

BodyFailure StubHttpFailure

A stable description of the content-consumption failure, or null when content has not been consumed or was consumed successfully.

Properties

Body

The response bytes captured during content consumption. Before consumption this is empty; after a failed read it contains the bytes written before failure. The exchange owns the memory.

public ReadOnlyMemory<byte> Body { get; init; }

Property Value

ReadOnlyMemory<byte>

BodyCaptured

true when the response has no content or content consumption has completed or failed; otherwise, false.

public bool BodyCaptured { get; init; }

Property Value

bool

BodyFailure

A stable description of the content-consumption failure, or null when content has not been consumed or was consumed successfully.

public StubHttpFailure? BodyFailure { get; init; }

Property Value

StubHttpFailure

Headers

A case-insensitive snapshot of response and content headers. The exchange owns the dictionary and nested arrays; callers must not mutate them.

public IReadOnlyDictionary<string, string[]> Headers { get; init; }

Property Value

IReadOnlyDictionary<string, string[]>

ReasonPhrase

The optional HTTP reason phrase, or null when none was supplied.

public string? ReasonPhrase { get; init; }

Property Value

string

StatusCode

The numeric HTTP status code returned by the stub.

public int StatusCode { get; init; }

Property Value

int