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

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

返回

CorsPolicyBuilder

当前策略生成器。

适用于