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
MethodHttpMethodThe non-null HTTP method from the outbound request. The snapshot does not own or mutate it.
RequestUriUriThe request URI as observed by the handler, or null when the outbound request had no URI. Query values are stored without redaction.
HeadersIReadOnlyDictionary<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.
BodystringThe 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
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
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
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; }