Other 5xx codes
All HTTP status codes in ASP.NET Core
5xx Server error
Not a standard code. Cloudflare sends it when it times out contacting the origin: no answer to its TCP connection within 19 seconds, or no acknowledgment of the request within 90 seconds after connecting.
In ASP.NET Core: Your app never sends it. The origin is offline or overloaded, a firewall blocks or rate-limits Cloudflare's IP ranges, or the DNS record points at the wrong IP address.
The StatusCodes constant, HttpStatusCode enum name, reason phrase, class, and how EnsureSuccessStatusCode() and the standard resilience handler treat 522.
| Constant | none |
|---|---|
| HttpStatusCode | none; use (HttpStatusCode)522 |
| Reason phrase | Kestrel sends none; HttpClient's ReasonPhrase is null; common name: Connection Timed Out |
| Class | 5xx, server error |
| IsSuccessStatusCode | false |
| EnsureSuccessStatusCode() | throws HttpRequestException: Response status code does not indicate success: 522. |
| Standard resilience handler | retries it (treated as transient) |
Results.StatusCode(522)
Results.Problem(statusCode: 522, detail: "...")StatusCode(522)
Problem(statusCode: 522, detail: "...")What Results.Problem(statusCode: 522) sends (with AddProblemDetails()), as application/problem+json:
{
"status": 522,
"traceId": "0HNA1B2C3D4E5:00000001"
}A controller's Problem(statusCode: 522) sends the same body.
A bare StatusCode(522) in an [ApiController] also gets a ProblemDetails body automatically; Results.StatusCode(522) 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