CorsPolicy Class
- java.
lang. Object - com.
azure. resourcemanager. cosmos. models. CorsPolicy
- com.
Implements
public final class CorsPolicy
implements JsonSerializable<CorsPolicy>
The CORS policy for the Cosmos DB database account.
Constructor Summary
Constructor | Description |
---|---|
CorsPolicy() |
Creates an instance of Cors |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
allowedHeaders()
Get the allowed |
String |
allowedMethods()
Get the allowed |
String |
allowedOrigins()
Get the allowed |
String |
exposedHeaders()
Get the exposed |
static
Cors |
fromJson(JsonReader jsonReader)
Reads an instance of Cors |
Long |
maxAgeInSeconds()
Get the max |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Cors |
withAllowedHeaders(String allowedHeaders)
Set the allowed |
Cors |
withAllowedMethods(String allowedMethods)
Set the allowed |
Cors |
withAllowedOrigins(String allowedOrigins)
Set the allowed |
Cors |
withExposedHeaders(String exposedHeaders)
Set the exposed |
Cors |
withMaxAgeInSeconds(Long maxAgeInSeconds)
Set the max |
Methods inherited from java.lang.Object
Constructor Details
CorsPolicy
public CorsPolicy()
Creates an instance of CorsPolicy class.
Method Details
allowedHeaders
public String allowedHeaders()
Get the allowedHeaders property: The request headers that the origin domain may specify on the CORS request.
Returns:
allowedMethods
public String allowedMethods()
Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request.
Returns:
allowedOrigins
public String allowedOrigins()
Get the allowedOrigins property: The origin domains that are permitted to make a request against the service via CORS.
Returns:
exposedHeaders
public String exposedHeaders()
Get the exposedHeaders property: The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
Returns:
fromJson
public static CorsPolicy fromJson(JsonReader jsonReader)
Reads an instance of CorsPolicy from the JsonReader.
Parameters:
Returns:
Throws:
maxAgeInSeconds
public Long maxAgeInSeconds()
Get the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS request.
Returns:
toJson
validate
public void validate()
Validates the instance.
withAllowedHeaders
public CorsPolicy withAllowedHeaders(String allowedHeaders)
Set the allowedHeaders property: The request headers that the origin domain may specify on the CORS request.
Parameters:
Returns:
withAllowedMethods
public CorsPolicy withAllowedMethods(String allowedMethods)
Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request.
Parameters:
Returns:
withAllowedOrigins
public CorsPolicy withAllowedOrigins(String allowedOrigins)
Set the allowedOrigins property: The origin domains that are permitted to make a request against the service via CORS.
Parameters:
Returns:
withExposedHeaders
public CorsPolicy withExposedHeaders(String exposedHeaders)
Set the exposedHeaders property: The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
Parameters:
Returns:
withMaxAgeInSeconds
public CorsPolicy withMaxAgeInSeconds(Long maxAgeInSeconds)
Set the maxAgeInSeconds property: The maximum amount time that a browser should cache the preflight OPTIONS request.
Parameters:
Returns:
Applies to
Azure SDK for Java