Other 3xx codes
All HTTP status codes in ASP.NET Core
3xx Redirection
Reserved. It was once "Switch Proxy" and is no longer used.
In ASP.NET Core: Do not use it.
The StatusCodes constant, HttpStatusCode enum name, reason phrase, class, and how EnsureSuccessStatusCode() and the standard resilience handler treat 306.
| Constant | StatusCodes.Status306SwitchProxy |
|---|---|
| HttpStatusCode | HttpStatusCode.Unused |
| Reason phrase | Kestrel sends Switch Proxy; HttpClient's ReasonPhrase is null |
| Class | 3xx, redirection |
| IsSuccessStatusCode | false |
| EnsureSuccessStatusCode() | throws HttpRequestException: Response status code does not indicate success: 306. |
| Standard resilience handler | does not retry it |
| HttpClient redirect | GET: not followed. POST: not followed. |
Results.StatusCode(StatusCodes.Status306SwitchProxy)
Results.Problem(statusCode: StatusCodes.Status306SwitchProxy, detail: "...")StatusCode(StatusCodes.Status306SwitchProxy)
Problem(statusCode: StatusCodes.Status306SwitchProxy, detail: "...")What Results.Problem(statusCode: 306) sends (with AddProblemDetails()), as application/problem+json:
{
"title": "Switch Proxy",
"status": 306,
"traceId": "0HNA1B2C3D4E5:00000001"
}A controller's Problem(statusCode: 306) sends a different body, because MVC only fills type and title for codes in ApiBehaviorOptions.ClientErrorMapping:
{
"status": 306,
"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