Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EnableCorsAttribute Class

 

This class defines an attribute that can be applied to an action or a controller to enable CORS. By default, it allows all origins, methods and headers.

Namespace:   System.Web.Http.Cors
Assembly:  System.Web.Http.Cors (in System.Web.Http.Cors.dll)

System::Object
  System::Attribute
    System.Web.Http.Cors::EnableCorsAttribute

[AttributeUsageAttribute(AttributeTargets::Class | AttributeTargets::Method, 
	AllowMultiple = false)]
public ref class EnableCorsAttribute sealed : Attribute, ICorsPolicyProvider

NameDescription
System_CAPS_pubmethodEnableCorsAttribute(String^, String^, String^)

Initializes a new instance of the EnableCorsAttribute class.

System_CAPS_pubmethodEnableCorsAttribute(String^, String^, String^, String^)

Initializes a new instance of the EnableCorsAttribute class.

NameDescription
System_CAPS_pubpropertyExposedHeaders

Gets the headers that the resource might use and can be exposed.

System_CAPS_pubpropertyHeaders

Gets the headers that are supported by the resource.

System_CAPS_pubpropertyMethods

Gets the methods that are supported by the resource.

System_CAPS_pubpropertyOrigins

Gets the origins that are allowed to access the resource.

System_CAPS_pubpropertyPreflightMaxAge

Gets or sets the number of seconds the results of a preflight request can be cached.

System_CAPS_pubpropertySupportsCredentials

Gets or sets a value indicating whether the resource supports user credentials in the request.

System_CAPS_pubpropertyTypeId

(Inherited from Attribute.)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: