Modifies the cross-origin resource sharing (CORS) policy of a route.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:UpdateGatewayRouteCORS |
update |
*Gateway
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Id |
integer |
Yes |
The ID of the associated record. |
55 |
| GatewayId |
integer |
No |
The ID of the gateway. |
85 |
| CorsJSON |
object |
No |
The information about the CORS policy. |
|
| Status |
string |
No |
The status of the policy. |
off |
| AllowOrigins |
string |
No |
The origins from which access is allowed. |
https://api.aliyun-inc.com/ |
| AllowMethods |
string |
No |
The HTTP methods allowed. |
GET,POST |
| AllowHeaders |
string |
No |
The request headers allowed. |
content-type |
| ExposeHeaders |
string |
No |
The response headers allowed. |
* |
| TimeUnit |
string |
No |
The unit of time. |
h |
| UnitNum |
integer |
No |
The value of time. |
24 |
| AllowCredentials |
boolean |
No |
The credentials allowed. |
true |
| GatewayUniqueId |
string |
Yes |
The unique ID of the gateway. |
gw-f70a6ddf2f0941a2bb997b2d16028f37 |
| AcceptLanguage |
string |
No |
The language of the response. In compliance with RFC 7231, the backend service must return a response based on the language used by the user.
|
zh |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The schema of the response. |
||
| RequestId |
string |
The ID of the request. |
41BE990E-44E4-5ED3-AEEB-A276941B1854 |
| HttpStatusCode |
integer |
The HTTP status code returned. |
200 |
| Message |
string |
The error message. |
You are not authorized to perform this operation. |
| Code |
integer |
The status code returned. |
200 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
| Data |
integer |
The data structure. |
618 |
Examples
Success response
JSON format
{
"RequestId": "41BE990E-44E4-5ED3-AEEB-A276941B1854",
"HttpStatusCode": 200,
"Message": "You are not authorized to perform this operation. ",
"Code": 200,
"Success": true,
"Data": 618
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | Invalid request: %s |
| 400 | InvalidParameter | Parameter error:%s | Request parameter error: %s |
| 500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | You do not have the permission to use this interface:%s |
| 404 | NotFound | Not found:%s | The resource does not exist:%s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.