Other 3xx codes
All HTTP status codes in ASP.NET Core
3xx Redirection
The resource has several representations and the client should choose one.
In ASP.NET Core: Almost never used.
The StatusCodes constant, HttpStatusCode enum name, reason phrase, class, and how EnsureSuccessStatusCode() and the standard resilience handler treat 300.
| Constant | StatusCodes.Status300MultipleChoices |
|---|---|
| HttpStatusCode | HttpStatusCode.MultipleChoices, HttpStatusCode.Ambiguous (aliases, same value) |
| Reason phrase | Kestrel sends Multiple Choices |
| Class | 3xx, redirection |
| IsSuccessStatusCode | false |
| EnsureSuccessStatusCode() | throws HttpRequestException: Response status code does not indicate success: 300 (Multiple Choices). |
| Standard resilience handler | does not retry it |
| HttpClient redirect | GET: followed, as GET. POST: followed, as GET. |
Results.StatusCode(StatusCodes.Status300MultipleChoices)
Results.Problem(statusCode: StatusCodes.Status300MultipleChoices, detail: "...")StatusCode(StatusCodes.Status300MultipleChoices)
Problem(statusCode: StatusCodes.Status300MultipleChoices, detail: "...")What Results.Problem(statusCode: 300) sends (with AddProblemDetails()), as application/problem+json:
{
"title": "Multiple Choices",
"status": 300,
"traceId": "0HNA1B2C3D4E5:00000001"
}A controller's Problem(statusCode: 300) sends a different body, because MVC only fills type and title for codes in ApiBehaviorOptions.ClientErrorMapping:
{
"status": 300,
"traceId": "0HNA1B2C3D4E5:00000001"
}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