CorsSettings Class

  • java.lang.Object
    • com.azure.resourcemanager.appservice.models.CorsSettings

Implements

public final class CorsSettings
implements JsonSerializable<CorsSettings>

Cross-Origin Resource Sharing (CORS) settings for the app.

Constructor Summary

Constructor Description
CorsSettings()

Creates an instance of CorsSettings class.

Method Summary

Modifier and Type Method and Description
List<String> allowedOrigins()

Get the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345).

static CorsSettings fromJson(JsonReader jsonReader)

Reads an instance of CorsSettings from the JsonReader.

Boolean supportCredentials()

Get the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

CorsSettings withAllowedOrigins(List<String> allowedOrigins)

Set the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345).

CorsSettings withSupportCredentials(Boolean supportCredentials)

Set the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed.

Methods inherited from java.lang.Object

Constructor Details

CorsSettings

public CorsSettings()

Creates an instance of CorsSettings class.

Method Details

allowedOrigins

public List allowedOrigins()

Get the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all.

Returns:

the allowedOrigins value.

fromJson

public static CorsSettings fromJson(JsonReader jsonReader)

Reads an instance of CorsSettings from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of CorsSettings if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the CorsSettings.

supportCredentials

public Boolean supportCredentials()

Get the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\#Requests\_with\_credentials for more details.

Returns:

the supportCredentials value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withAllowedOrigins

public CorsSettings withAllowedOrigins(List allowedOrigins)

Set the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all.

Parameters:

allowedOrigins - the allowedOrigins value to set.

Returns:

the CorsSettings object itself.

withSupportCredentials

public CorsSettings withSupportCredentials(Boolean supportCredentials)

Set the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\#Requests\_with\_credentials for more details.

Parameters:

supportCredentials - the supportCredentials value to set.

Returns:

the CorsSettings object itself.

Applies to