Partager via


TableServiceCorsRule Class

  • java.lang.Object
    • com.azure.data.tables.models.TableServiceCorsRule

public final class TableServiceCorsRule

CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain.

Constructor Summary

Constructor Description
TableServiceCorsRule()

Creates an instance of TableServiceCorsRule.

Method Summary

Modifier and Type Method and Description
String getAllowedHeaders()

Get the request headers that the origin domain may specify on the CORS request.

String getAllowedMethods()

Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request.

String getAllowedOrigins()

Get the origin domains that are permitted to make a request against the service via CORS.

String getExposedHeaders()

Get the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.

int getMaxAgeInSeconds()

Get the maximum amount time that a browser should cache the preflight OPTIONS request.

TableServiceCorsRule setAllowedHeaders(String allowedHeaders)

Set the request headers that the origin domain may specify on the CORS request.

TableServiceCorsRule setAllowedMethods(String allowedMethods)

Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request.

TableServiceCorsRule setAllowedOrigins(String allowedOrigins)

Set the allowedOrigins property: The origin domains that are permitted to make a request against the service via CORS.

TableServiceCorsRule setExposedHeaders(String exposedHeaders)

Set the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.

TableServiceCorsRule setMaxAgeInSeconds(int maxAgeInSeconds)

Set the maximum amount time that a browser should cache the preflight OPTIONS request.

Methods inherited from java.lang.Object

Constructor Details

TableServiceCorsRule

public TableServiceCorsRule()

Creates an instance of TableServiceCorsRule.

Method Details

getAllowedHeaders

public String getAllowedHeaders()

Get the request headers that the origin domain may specify on the CORS request.

Returns:

The allowedHeaders.

getAllowedMethods

public String getAllowedMethods()

Get the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated).

Returns:

The allowedMethods.

getAllowedOrigins

public String getAllowedOrigins()

Get the origin domains that are permitted to make a request against the service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.

Returns:

The allowedOrigins.

getExposedHeaders

public String getExposedHeaders()

Get the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.

Returns:

The exposedHeaders value.

getMaxAgeInSeconds

public int getMaxAgeInSeconds()

Get the maximum amount time that a browser should cache the preflight OPTIONS request.

Returns:

The maxAgeInSeconds.

setAllowedHeaders

public TableServiceCorsRule setAllowedHeaders(String allowedHeaders)

Set the request headers that the origin domain may specify on the CORS request.

Parameters:

allowedHeaders - The allowedHeaders to set.

Returns:

The updated TableServiceCorsRule object.

setAllowedMethods

public TableServiceCorsRule setAllowedMethods(String allowedMethods)

Set the allowedMethods property: The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated).

Parameters:

allowedMethods - The allowedMethods to set.

Returns:

The updated TableServiceCorsRule object.

setAllowedOrigins

public TableServiceCorsRule setAllowedOrigins(String allowedOrigins)

Set the allowedOrigins property: The origin domains that are permitted to make a request against the service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.

Parameters:

allowedOrigins - The allowedOrigins to set.

Returns:

The updated TableServiceCorsRule object.

setExposedHeaders

public TableServiceCorsRule setExposedHeaders(String exposedHeaders)

Set the response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.

Parameters:

exposedHeaders - The exposedHeaders to set.

Returns:

The updated TableServiceCorsRule object.

setMaxAgeInSeconds

public TableServiceCorsRule setMaxAgeInSeconds(int maxAgeInSeconds)

Set the maximum amount time that a browser should cache the preflight OPTIONS request.

Parameters:

maxAgeInSeconds - The maxAgeInSeconds to set.

Returns:

The updated TableServiceCorsRule object.

Applies to