CorsHttpConfigurationExtensions.EnableCors Method
Namespace: System.Web.Http
Assembly: System.Web.Http.Cors (in System.Web.Http.Cors.dll)
Overload List
Name | Description | |
---|---|---|
EnableCors(HttpConfiguration) | Enables the support for CORS. |
|
EnableCors(HttpConfiguration, ICorsPolicyProvider) | Enables the support for CORS. |
See Also
CorsHttpConfigurationExtensions Class
System.Web.Http Namespace
Return to top
CorsHttpConfigurationExtensions.EnableCors Method (HttpConfiguration)
Enables the support for CORS.
Syntax
public static void EnableCors(
this HttpConfiguration httpConfiguration
)
public:
[ExtensionAttribute]
static void EnableCors(
HttpConfiguration^ httpConfiguration
)
static member EnableCors :
httpConfiguration:HttpConfiguration -> unit
<ExtensionAttribute>
Public Shared Sub EnableCors (
httpConfiguration As HttpConfiguration
)
Parameters
httpConfiguration
Type: System.Web.Http.HttpConfigurationThe HttpConfiguration.
Return to top
CorsHttpConfigurationExtensions.EnableCors Method (HttpConfiguration, ICorsPolicyProvider)
Enables the support for CORS.
Syntax
public static void EnableCors(
this HttpConfiguration httpConfiguration,
ICorsPolicyProvider defaultPolicyProvider
)
public:
[ExtensionAttribute]
static void EnableCors(
HttpConfiguration^ httpConfiguration,
ICorsPolicyProvider^ defaultPolicyProvider
)
static member EnableCors :
httpConfiguration:HttpConfiguration *
defaultPolicyProvider:ICorsPolicyProvider -> unit
<ExtensionAttribute>
Public Shared Sub EnableCors (
httpConfiguration As HttpConfiguration,
defaultPolicyProvider As ICorsPolicyProvider
)
Parameters
httpConfiguration
Type: System.Web.Http.HttpConfigurationThe HttpConfiguration.
defaultPolicyProvider
Type: System.Web.Http.Cors.ICorsPolicyProviderThe default ICorsPolicyProvider.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | httpConfiguration |
Return to top