Interface CfnApi.ICorsProperty
The Cors
property specifies a CORS configuration for an API.
Namespace: Amazon.CDK.AWS.APIGatewayv2
Assembly: Amazon.CDK.AWS.APIGatewayv2.dll
Syntax (csharp)
public interface ICorsProperty
Syntax (vb)
Public Interface 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
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. |
Properties
AllowCredentials
Specifies whether credentials are included in the CORS request.
virtual object AllowCredentials { get; }
Property Value
System.Object
Remarks
AllowHeaders
Represents a collection of allowed headers.
virtual string[] AllowHeaders { get; }
Property Value
System.String[]
Remarks
Supported only for HTTP APIs.
AllowMethods
Represents a collection of allowed HTTP methods.
virtual string[] AllowMethods { get; }
Property Value
System.String[]
Remarks
Supported only for HTTP APIs.
AllowOrigins
Represents a collection of allowed origins.
virtual string[] AllowOrigins { get; }
Property Value
System.String[]
Remarks
Supported only for HTTP APIs.
ExposeHeaders
Represents a collection of exposed headers.
virtual string[] ExposeHeaders { get; }
Property Value
System.String[]
Remarks
Supported only for HTTP APIs.
MaxAge
The number of seconds that the browser should cache preflight request results.
virtual Nullable<double> MaxAge { get; }
Property Value
System.Nullable<System.Double>
Remarks
Supported only for HTTP APIs.