Other 4xx codes
All HTTP status codes in ASP.NET Core
4xx Client error
The server is unwilling to risk processing a request that might be replayed (RFC 8470). It answers requests sent in TLS 1.3 early data (0-RTT); the client should retry automatically once the handshake completes, without early data.
In ASP.NET Core: Not something an API returns. .NET has no StatusCodes constant or HttpStatusCode member for it; use (HttpStatusCode)425 or 425 when you need to match it. HttpClient's standard resilience handler does not retry it.
The StatusCodes constant, HttpStatusCode enum name, reason phrase, class, and how EnsureSuccessStatusCode() and the standard resilience handler treat 425.
| Constant | none |
|---|---|
| HttpStatusCode | none; use (HttpStatusCode)425 |
| Reason phrase | Kestrel sends none; HttpClient's ReasonPhrase is null; RFC name: Too Early |
| Class | 4xx, client error |
| IsSuccessStatusCode | false |
| EnsureSuccessStatusCode() | throws HttpRequestException: Response status code does not indicate success: 425. |
| Standard resilience handler | does not retry it |
Results.StatusCode(425)
Results.Problem(statusCode: 425, detail: "...")StatusCode(425)
Problem(statusCode: 425, detail: "...")What Results.Problem(statusCode: 425) sends (with AddProblemDetails()), as application/problem+json:
{
"status": 425,
"traceId": "0HNA1B2C3D4E5:00000001"
}A controller's Problem(statusCode: 425) sends the same body.
A bare StatusCode(425) in an [ApiController] also gets a ProblemDetails body automatically; Results.StatusCode(425) in a minimal API sends an empty body unless you add UseStatusCodePages().
Every response on this page was recorded from ASP.NET Core 10.0.12 on Kestrel in the Production environment; the HttpClient rows come from .NET 10.0.12 and Microsoft.Extensions.Http.Resilience 10.10.0.
All HTTP status codes in ASP.NET Core