Edit CORS Headers
This API is used to edit CORS headers for website acceleration or file download service. Only headers present in the request body are updated, if there are any other CORS headers set for the service they are left untouched. Use empty string to remove the corresponding header.
1. Request Definition
- API URL
https://cdn-api.swiftfederation.com/v1.0/services/{serviceId}/cors_headers
- Request Method
PUT
- Request Header
Refer to HTTP Request Headers
- Request Body
Request Body Data Format: JSON
Field | Required | Type | Description |
---|---|---|---|
Access-Control-Allow-Origin | Optional | string | Response can be shared with requesting code from the given origin. Please note that null value is not allowed. E.g. "*", "http://example.com". |
Access-Control-Expose-Headers | Optional | string | Headers can be exposed as part of the response by listing their names. This header accepts any string value. E.g. "Content-Length". |
Access-Control-Max-Age | Optional | int | how long in seconds the results of a preflight request can be cached. The provided value must be either non-negative int or -1. |
Access-Control-Allow-Credentials | Optional | boolean | Whether to expose the response to frontend JavaScript code. E.g. "true" |
Access-Control-Allow-Methods | Optional | string | methods allowed when accessing the resource in response to a preflight request. It should be either single http method or comma-separated list of http methods: GET, POST, PUT, DELETE, HEAD, OPTIONS, CONNECT and TRACE. E.g. "GET, POST" |
Access-Control-Allow-Headers | Optional | string | HTTP headers can be used during the actual request. This header accepts any string value. E.g. "X-Customer-Token" |
- Request Body Example
{
"Access-Control-Allow-Origin": "*",
"Access-Control-Max-Age": 600,
"Access-Control-Allow-Methods": "GET, POST"
}
2. Response Definition
- Response Header
Refer to HTTP Response Headers
- Response Body
No response body for this API.