Other 3xx codes
All HTTP status codes in ASP.NET Core
3xx Redirection
Deprecated (RFC 7231) for security reasons.
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 305.
| Constant | StatusCodes.Status305UseProxy |
|---|---|
| HttpStatusCode | HttpStatusCode.UseProxy |
| Reason phrase | Kestrel sends Use Proxy |
| Class | 3xx, redirection |
| IsSuccessStatusCode | false |
| EnsureSuccessStatusCode() | throws HttpRequestException: Response status code does not indicate success: 305 (Use Proxy). |
| Standard resilience handler | does not retry it |
| HttpClient redirect | GET: not followed. POST: not followed. |
Results.StatusCode(StatusCodes.Status305UseProxy)
Results.Problem(statusCode: StatusCodes.Status305UseProxy, detail: "...")StatusCode(StatusCodes.Status305UseProxy)
Problem(statusCode: StatusCodes.Status305UseProxy, detail: "...")What Results.Problem(statusCode: 305) sends (with AddProblemDetails()), as application/problem+json:
{
"title": "Use Proxy",
"status": 305,
"traceId": "0HNA1B2C3D4E5:00000001"
}A controller's Problem(statusCode: 305) sends a different body, because MVC only fills type and title for codes in ApiBehaviorOptions.ClientErrorMapping:
{
"status": 305,
"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