CorsMiddlewareExtensions.UseCors Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
UseCors(IApplicationBuilder) |
Adds a CORS middleware to your web application pipeline to allow cross domain requests. |
UseCors(IApplicationBuilder, Action<CorsPolicyBuilder>) |
Adds a CORS middleware to your web application pipeline to allow cross domain requests. |
UseCors(IApplicationBuilder, String) |
Adds a CORS middleware to your web application pipeline to allow cross domain requests. |
UseCors(IApplicationBuilder)
- Source:
- CorsMiddlewareExtensions.cs
- Source:
- CorsMiddlewareExtensions.cs
- Source:
- CorsMiddlewareExtensions.cs
Adds a CORS middleware to your web application pipeline to allow cross domain requests.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseCors(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseCors (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseCors : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseCors (app As IApplicationBuilder) As IApplicationBuilder
Parameters
The IApplicationBuilder passed to your Configure method
Returns
The original app parameter
Applies to
UseCors(IApplicationBuilder, Action<CorsPolicyBuilder>)
- Source:
- CorsMiddlewareExtensions.cs
- Source:
- CorsMiddlewareExtensions.cs
- Source:
- CorsMiddlewareExtensions.cs
Adds a CORS middleware to your web application pipeline to allow cross domain requests.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseCors(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Action<Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicyBuilder ^> ^ configurePolicy);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseCors (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> configurePolicy);
static member UseCors : Microsoft.AspNetCore.Builder.IApplicationBuilder * Action<Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseCors (app As IApplicationBuilder, configurePolicy As Action(Of CorsPolicyBuilder)) As IApplicationBuilder
Parameters
The IApplicationBuilder passed to your Configure method.
- configurePolicy
- Action<CorsPolicyBuilder>
A delegate which can use a policy builder to build a policy.
Returns
The original app parameter
Applies to
UseCors(IApplicationBuilder, String)
- Source:
- CorsMiddlewareExtensions.cs
- Source:
- CorsMiddlewareExtensions.cs
- Source:
- CorsMiddlewareExtensions.cs
Adds a CORS middleware to your web application pipeline to allow cross domain requests.
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseCors(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, System::String ^ policyName);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseCors (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string policyName);
static member UseCors : Microsoft.AspNetCore.Builder.IApplicationBuilder * string -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseCors (app As IApplicationBuilder, policyName As String) As IApplicationBuilder
Parameters
The IApplicationBuilder passed to your Configure method
- policyName
- String
The policy name of a configured policy.
Returns
The original app parameter