StubResponse class¶
Defined in
Namespace: Refit.Testing
Assembly: Refit.Testing.dll
Full name: Refit.Testing.StubResponse
Modifiers: public sealed
Summary¶
The response a StubHttp returns for a matched RouteMatcher. Build it with the Reply factory rather than constructing it directly; the properties are exposed so a test can read what a reply carries.
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481, net471
Constructors¶
| Name | Summary |
|---|---|
| .ctor |
Properties¶
| Name | Summary |
|---|---|
| Status | Gets the response status code. Defaults to OK. |
| Json | Gets a raw JSON response body; sets the content type to application/json. |
| Text | Gets a plain-text response body paired with [ContentType](# (default text/plain). |
| ContentType | Gets the content type for [Text](# |
| Content | Gets an explicit response content, used verbatim. |
| Responder | Gets a factory that produces the full response from the request, for total control. |
| ResponderAsync | Gets an asynchronous factory that produces the full response, for responders that await. Takes precedence over [Responder](# |