Class StubHttpRequest

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

A captured outbound HTTP request received by StubHttpMessageHandler.

public sealed record StubHttpRequest : IEquatable<StubHttpRequest>
Inheritance
StubHttpRequest
Implements
Inherited Members
Extension Methods

Constructors

StubHttpRequest(HttpMethod, Uri?, IReadOnlyDictionary<string, string[]>, string?)

A captured outbound HTTP request received by StubHttpMessageHandler.

public StubHttpRequest(HttpMethod Method, Uri? RequestUri, IReadOnlyDictionary<string, string[]> Headers, string? Body)

Parameters

Method HttpMethod

The non-null HTTP method from the outbound request. The snapshot does not own or mutate it.

RequestUri Uri

The request URI as observed by the handler, or null when the outbound request had no URI. Query values are stored without redaction.

Headers IReadOnlyDictionary<string, string[]>

A case-insensitive snapshot containing request and content headers. The handler owns the dictionary and nested arrays; callers must not mutate them. Values are not redacted.

Body string

The request content captured as text, or null when the request had no content. An empty content body is represented by an empty string. Values are not redacted.

Properties

Body

The request content captured as text, or null when the request had no content. An empty content body is represented by an empty string. Values are not redacted.

public string? Body { get; init; }

Property Value

string

Headers

A case-insensitive snapshot containing request and content headers. The handler owns the dictionary and nested arrays; callers must not mutate them. Values are not redacted.

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

Property Value

IReadOnlyDictionary<string, string[]>

Method

The non-null HTTP method from the outbound request. The snapshot does not own or mutate it.

public HttpMethod Method { get; init; }

Property Value

HttpMethod

RequestUri

The request URI as observed by the handler, or null when the outbound request had no URI. Query values are stored without redaction.

public Uri? RequestUri { get; init; }

Property Value

Uri