CorsPolicy class

The specification for allowing client-side cross-origin requests.

For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard.

Constructors

CorsPolicy({bool? allowCredentials, List<String>? allowHeaders, List<String>? allowMethods, List<String>? allowOriginRegexes, List<String>? allowOrigins, bool? disabled, List<String>? exposeHeaders, int? maxAge})
CorsPolicy.fromJson(Map json_)

Properties

allowCredentials bool?
In response to a preflight request, setting this to true indicates that the actual request can include user credentials.
getter/setter pair
allowHeaders List<String>?
Specifies the content for the Access-Control-Allow-Headers header.
getter/setter pair
allowMethods List<String>?
Specifies the content for the Access-Control-Allow-Methods header.
getter/setter pair
allowOriginRegexes List<String>?
Specifies a regular expression that matches allowed origins.
getter/setter pair
allowOrigins List<String>?
Specifies the list of origins that is allowed to do CORS requests.
getter/setter pair
disabled bool?
If true, the setting specifies the CORS policy is disabled.
getter/setter pair
exposeHeaders List<String>?
Specifies the content for the Access-Control-Expose-Headers header.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
maxAge int?
Specifies how long results of a preflight request can be cached in seconds.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited