Skip to main content

Get CORS Headers

Retrieves CORS Headers for website accleration domain.

Request

Request-Line

GET /waap/v1.0/services/{serviceId}/corsHeaders HTTP/1.1

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
serviceIdIntegerMandatoryService ID.

Response

Response Body

ParameterTypeRequiredDescription
accessControlAllowOriginStringOptionalResponse can be shared with requesting code from the given origin. Please note that null value is not allowed, it must be either '*' or 'scheme://fqdn'.
accessControlExposeHeadersStringOptionalHeaders can be exposed as part of the response by listing their names. This header accepts any string value. E.g. "Content-Length".
accessControlMaxAgeIntegerOptionalMaximum time in seconds that a CORS preflight response can be cached. Accepts non-negative integers or -1 (0 = no cache, -1 = cache indefinitely).
accessControlAllowCredentialsBooleanOptionalIndicates whether the response can be exposed to frontend JavaScript. Must be true.
accessControlAllowMethodsStringOptionalAccepts a single method or a comma-separated list from: GET, POST, PUT, DELETE, HEAD, OPTIONS, CONNECT, TRACE.
accessControlAllowHeadersStringOptionalHTTP headers can be used during the actual request. This header accepts any string value. E.g. "X-Customer-Token".

Status Codes, Error Codes and Error Messages

Status CodeError CodeError Message
400ServiceId.InvalidServiceId is empty or invalid.
400CorsHeaders.OperationFailedThe Cors Headers operation failed.
404ServiceId.NotFoundServiceId is not found.

Examples

Get CORS Headers

Request

GET /waap/v1.0/services/12345/corsHeaders HTTP/1.1

Successful Response Body

{
"accessControlExposeHeaders": "Content-Length, X-Request-Id",
"accessControlMaxAge": "3600",
"accessControlAllowCredentials": "true",
"accessControlAllowOrigin": "https://www.example.com",
"accessControlAllowHeaders": "Content-Type, Authorization",
"accessControlAllowMethods": "GET,POST,OPTIONS"
}