共用方式為


CorsPolicyBuilder.WithHeaders(String[]) 方法

定義

將指定的 headers 加入至原則。

public:
 Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicyBuilder ^ WithHeaders(... cli::array <System::String ^> ^ headers);
public Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder WithHeaders (params string[] headers);
member this.WithHeaders : string[] -> Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder
Public Function WithHeaders (ParamArray headers As String()) As CorsPolicyBuilder

參數

headers
String[]

要求中必須允許的標頭。

傳回

目前的原則產生器。

適用於