StatusCodePagesExtensions Class¶
- Namespace
Microsoft.AspNetCore.Builder
- Assemblies
- Microsoft.AspNetCore.Diagnostics
Syntax¶
public class StatusCodePagesExtensions
-
class
Microsoft.AspNetCore.Builder.
StatusCodePagesExtensions
Methods¶
-
UseStatusCodePages
(Microsoft.AspNetCore.Builder.IApplicationBuilder)¶ Adds a StatusCodePages middleware with a default response handler that checks for responses with status codes between 400 and 599 that do not have a body.
Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder app)
-
UseStatusCodePages
(Microsoft.AspNetCore.Builder.IApplicationBuilder, Microsoft.AspNetCore.Builder.StatusCodePagesOptions) Adds a StatusCodePages middleware with the given options that checks for responses with status codes between 400 and 599 that do not have a body.
Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder app, StatusCodePagesOptions options)
-
UseStatusCodePages
(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>) Adds a StatusCodePages middleware to the pipeline with the specified alternate middleware pipeline to execute to generate the response body.
Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder app, Action<IApplicationBuilder> configuration)
-
UseStatusCodePages
(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.Func<Microsoft.AspNetCore.Diagnostics.StatusCodeContext, System.Threading.Tasks.Task>) Adds a StatusCodePages middleware with the specified handler that checks for responses with status codes between 400 and 599 that do not have a body.
Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder app, Func<StatusCodeContext, Task> handler)
-
UseStatusCodePages
(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.String, System.String) Adds a StatusCodePages middleware with the specified response body to send. This may include a ‘{0}’ placeholder for the status code. The middleware checks for responses with status codes between 400 and 599 that do not have a body.
Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder public static IApplicationBuilder UseStatusCodePages(this IApplicationBuilder app, string contentType, string bodyFormat)
-
UseStatusCodePagesWithReExecute
(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.String, System.String)¶ Adds a StatusCodePages middleware to the pipeline. Specifies that the response body should be generated by re-executing the request pipeline using an alternate path. This path may contain a ‘{0}’ placeholder of the status code.
Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder public static IApplicationBuilder UseStatusCodePagesWithReExecute(this IApplicationBuilder app, string pathFormat, string queryFormat = null)
-
UseStatusCodePagesWithRedirects
(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.String)¶ Adds a StatusCodePages middleware to the pipeline. Specifies that responses should be handled by redirecting with the given location URL template. This may include a ‘{0}’ placeholder for the status code. URLs starting with ‘~’ will have PathBase prepended, where any other URL will be used as is.
Return type: Microsoft.AspNetCore.Builder.IApplicationBuilder public static IApplicationBuilder UseStatusCodePagesWithRedirects(this IApplicationBuilder app, string locationFormat)
-