Cross-Origin Query
Updated at:2025-11-03
API description
Before making a cross-domain request, the browser sends a preflight request (OPTIONS) containing specific origin domains, HTTP methods, and header details to BOS to determine whether the actual request should be sent. This API handles such preflight requests.
Request URI
OPTIONS /v1/{bucketName}/{object}
Parameters of request body
None
Response header parameters
| Parameter name | Parameter type | Description | Example value |
|---|---|---|---|
| Access-Control-Allow-Credentials | String | Determine if the BOS Server allows the client to include cookies in requests. This setting takes effect only with mutual consent from both the client and server. BOS returns "true" (case-sensitive) to indicate approval when the request is accepted. | |
| Access-Control-Allow-Headers | String | A list of headers permitted in the request. If the request includes any disallowed headers, the CORS rule validation will fail, and headers without Access-Control prefixes will be returned. Multiple headers are separated by commas. Note: Only the list of headers in this request is returned, regardless of any additional allowed headers specified in the configuration file. | |
| Access-Control-Allow-Methods | String | Permitted HTTP methods for the request. If the request method is not allowed, the header and all other Access-Control-related headers are omitted. Type: string. Note: The entire list of allowed methods is returned, not just the one used in this request. | |
| Access-Control-Allow-Origin | String | The origin specified in the request. If not allowed, the header and all other Access-Control-related headers are omitted. Type: string. | |
| Access-Control-Expose-Headers | String | A list of headers that can be accessed by the JavaScript program on the requester side. These correspond to exposeHeaders in the configuration file. Type: string. | |
| Access-Control-Max-Age | String | The duration in seconds for which the browser is permitted to cache preflight request results. Type: Integer. |
Response body parameters
None
Request example
None
Response example
None
Error code
Please refer to the general error codes
