Class CfnApi.CorsProperty
The Cors
property specifies a CORS configuration for an API.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.APIGatewayv2
Assembly: Amazon.CDK.AWS.APIGatewayv2.dll
Syntax (csharp)
public class CorsProperty : Object, CfnApi.ICorsProperty
Syntax (vb)
Public Class CorsProperty
Inherits Object
Implements CfnApi.ICorsProperty
Remarks
Supported only for HTTP APIs. See Configuring CORS for more information.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGatewayv2;
var corsProperty = new CorsProperty {
AllowCredentials = false,
AllowHeaders = new [] { "allowHeaders" },
AllowMethods = new [] { "allowMethods" },
AllowOrigins = new [] { "allowOrigins" },
ExposeHeaders = new [] { "exposeHeaders" },
MaxAge = 123
};
Synopsis
Constructors
CorsProperty() |
Properties
AllowCredentials | Specifies whether credentials are included in the CORS request. |
AllowHeaders | Represents a collection of allowed headers. |
AllowMethods | Represents a collection of allowed HTTP methods. |
AllowOrigins | Represents a collection of allowed origins. |
ExposeHeaders | Represents a collection of exposed headers. |
MaxAge | The number of seconds that the browser should cache preflight request results. |
Constructors
CorsProperty()
public CorsProperty()
Properties
AllowCredentials
Specifies whether credentials are included in the CORS request.
public object AllowCredentials { get; set; }
Property Value
System.Object
Remarks
AllowHeaders
Represents a collection of allowed headers.
public string[] AllowHeaders { get; set; }
Property Value
System.String[]
Remarks
Supported only for HTTP APIs.
AllowMethods
Represents a collection of allowed HTTP methods.
public string[] AllowMethods { get; set; }
Property Value
System.String[]
Remarks
Supported only for HTTP APIs.
AllowOrigins
Represents a collection of allowed origins.
public string[] AllowOrigins { get; set; }
Property Value
System.String[]
Remarks
Supported only for HTTP APIs.
ExposeHeaders
Represents a collection of exposed headers.
public string[] ExposeHeaders { get; set; }
Property Value
System.String[]
Remarks
Supported only for HTTP APIs.
MaxAge
The number of seconds that the browser should cache preflight request results.
public Nullable<double> MaxAge { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Supported only for HTTP APIs.