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[]

需要在请求中允许的标头。

返回

当前策略生成器。

适用于