Other 4xx codes
All HTTP status codes in ASP.NET Core
4xx Client error
The request URL is longer than the server will process.
In ASP.NET Core: Kestrel sends it when the request line exceeds MaxRequestLineSize (8 KB by default). Move large filters into a POST body.
The StatusCodes constant, HttpStatusCode enum name, reason phrase, class, and how EnsureSuccessStatusCode() and the standard resilience handler treat 414.
| Constant | StatusCodes.Status414RequestUriTooLong, StatusCodes.Status414UriTooLong |
|---|---|
| HttpStatusCode | HttpStatusCode.RequestUriTooLong |
| Reason phrase | Kestrel sends URI Too Long; HttpClient's ReasonPhrase is Request-Uri Too Long |
| Class | 4xx, client error |
| IsSuccessStatusCode | false |
| EnsureSuccessStatusCode() | throws HttpRequestException: Response status code does not indicate success: 414 (Request-Uri Too Long). |
| Standard resilience handler | does not retry it |
Results.StatusCode(StatusCodes.Status414RequestUriTooLong)
Results.Problem(statusCode: StatusCodes.Status414RequestUriTooLong, detail: "...")StatusCode(StatusCodes.Status414RequestUriTooLong)
Problem(statusCode: StatusCodes.Status414RequestUriTooLong, detail: "...")What Results.Problem(statusCode: 414) sends (with AddProblemDetails()), as application/problem+json:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.15",
"title": "URI Too Long",
"status": 414,
"traceId": "0HNA1B2C3D4E5:00000001"
}A controller's Problem(statusCode: 414) sends the same body.
A bare StatusCode(414) in an [ApiController] also gets a ProblemDetails body automatically; Results.StatusCode(414) in a minimal API sends an empty body unless you add UseStatusCodePages().
Setup
// any Kestrel appRequest
GET /aaaa...(9,000 characters) HTTP/1.1Response (recorded)
HTTP/1.1 414 URI Too LongThe request line exceeds Kestrel's MaxRequestLineSize (8,192 bytes by default).
Fix: Send large queries in a POST body, or raise KestrelServerOptions.Limits.MaxRequestLineSize.
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