StatusCodePagesExtensions.UseStatusCodePages 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
UseStatusCodePages(IApplicationBuilder) |
使用預設回應處理常式新增 StatusCodePages 中介軟體,以檢查狀態碼介於 400 到 599 之間沒有主體的回應。 |
UseStatusCodePages(IApplicationBuilder, StatusCodePagesOptions) |
使用指定的選項新增 StatusCodePages 中介軟體,以檢查狀態碼在 400 到 599 之間沒有本文的回應。 |
UseStatusCodePages(IApplicationBuilder, Action<IApplicationBuilder>) |
使用指定的替代中介軟體管線,將 StatusCodePages 中介軟體新增至管線,以執行 以產生回應本文。 |
UseStatusCodePages(IApplicationBuilder, Func<StatusCodeContext,Task>) |
使用指定的處理常式新增 StatusCodePages 中介軟體,以檢查狀態碼介於 400 到 599 之間沒有主體的回應。 |
UseStatusCodePages(IApplicationBuilder, String, String) |
新增具有要傳送之指定回應本文的 StatusCodePages 中介軟體。 這可能包括狀態碼的 ' {0} ' 預留位置。 中介軟體會檢查狀態碼介於 400 到 599 之間沒有主體的回應。 |
UseStatusCodePages(IApplicationBuilder)
使用預設回應處理常式新增 StatusCodePages 中介軟體,以檢查狀態碼介於 400 到 599 之間沒有主體的回應。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder) As IApplicationBuilder
參數
傳回
適用於
UseStatusCodePages(IApplicationBuilder, StatusCodePagesOptions)
使用指定的選項新增 StatusCodePages 中介軟體,以檢查狀態碼在 400 到 599 之間沒有本文的回應。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Builder::StatusCodePagesOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Builder.StatusCodePagesOptions options);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Builder.StatusCodePagesOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder, options As StatusCodePagesOptions) As IApplicationBuilder
參數
- options
- StatusCodePagesOptions
傳回
適用於
UseStatusCodePages(IApplicationBuilder, Action<IApplicationBuilder>)
使用指定的替代中介軟體管線,將 StatusCodePages 中介軟體新增至管線,以執行 以產生回應本文。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Action<Microsoft::AspNetCore::Builder::IApplicationBuilder ^> ^ configuration);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> configuration);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder * Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder, configuration As Action(Of IApplicationBuilder)) As IApplicationBuilder
參數
- configuration
- Action<IApplicationBuilder>
傳回
適用於
UseStatusCodePages(IApplicationBuilder, Func<StatusCodeContext,Task>)
使用指定的處理常式新增 StatusCodePages 中介軟體,以檢查狀態碼介於 400 到 599 之間沒有主體的回應。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Func<Microsoft::AspNetCore::Diagnostics::StatusCodeContext ^, System::Threading::Tasks::Task ^> ^ handler);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Func<Microsoft.AspNetCore.Diagnostics.StatusCodeContext,System.Threading.Tasks.Task> handler);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder * Func<Microsoft.AspNetCore.Diagnostics.StatusCodeContext, System.Threading.Tasks.Task> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder, handler As Func(Of StatusCodeContext, Task)) As IApplicationBuilder
參數
- handler
- Func<StatusCodeContext,Task>
傳回
適用於
UseStatusCodePages(IApplicationBuilder, String, String)
新增具有要傳送之指定回應本文的 StatusCodePages 中介軟體。 這可能包括狀態碼的 ' {0} ' 預留位置。 中介軟體會檢查狀態碼介於 400 到 599 之間沒有主體的回應。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseStatusCodePages(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, System::String ^ contentType, System::String ^ bodyFormat);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseStatusCodePages (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string contentType, string bodyFormat);
static member UseStatusCodePages : Microsoft.AspNetCore.Builder.IApplicationBuilder * string * string -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseStatusCodePages (app As IApplicationBuilder, contentType As String, bodyFormat As String) As IApplicationBuilder
參數
- contentType
- String
- bodyFormat
- String