EnableCorsAttribute Constructor

 

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

Overload List

Name Description
System_CAPS_pubmethod EnableCorsAttribute(String, String, String)

Initializes a new instance of the EnableCorsAttribute class.

System_CAPS_pubmethod EnableCorsAttribute(String, String, String, String)

Initializes a new instance of the EnableCorsAttribute class.

See Also

EnableCorsAttribute Class
System.Web.Http.Cors Namespace

Return to top

EnableCorsAttribute Constructor (String, String, String)

Initializes a new instance of the EnableCorsAttribute class.

Syntax

public EnableCorsAttribute(
    string origins,
    string headers,
    string methods
)
public:
EnableCorsAttribute(
    String^ origins,
    String^ headers,
    String^ methods
)
new : 
        origins:string *
        headers:string *
        methods:string -> EnableCorsAttribute
Public Sub New (
    origins As String,
    headers As String,
    methods As String
)

Parameters

  • origins
    Type: System.String

    Comma-separated list of origins that are allowed to access the resource. Use "*" to allow all.

  • headers
    Type: System.String

    Comma-separated list of headers that are supported by the resource. Use "*" to allow all. Use null or empty string to allow none.

  • methods
    Type: System.String

    Comma-separated list of methods that are supported by the resource. Use "*" to allow all. Use null or empty string to allow none.

Return to top

EnableCorsAttribute Constructor (String, String, String, String)

Initializes a new instance of the EnableCorsAttribute class.

Syntax

public EnableCorsAttribute(
    string origins,
    string headers,
    string methods,
    string exposedHeaders
)
public:
EnableCorsAttribute(
    String^ origins,
    String^ headers,
    String^ methods,
    String^ exposedHeaders
)
new : 
        origins:string *
        headers:string *
        methods:string *
        exposedHeaders:string -> EnableCorsAttribute
Public Sub New (
    origins As String,
    headers As String,
    methods As String,
    exposedHeaders As String
)

Parameters

  • origins
    Type: System.String

    Comma-separated list of origins that are allowed to access the resource. Use "*" to allow all.

  • headers
    Type: System.String

    Comma-separated list of headers that are supported by the resource. Use "*" to allow all. Use null or empty string to allow none.

  • methods
    Type: System.String

    Comma-separated list of methods that are supported by the resource. Use "*" to allow all. Use null or empty string to allow none.

  • exposedHeaders
    Type: System.String

    Comma-separated list of headers that the resource might use and can be exposed. Use null or empty string to expose none.

Return to top