OptionObject
Description
the browser will send a preflight request (OPTIONS) and bring a specific source domain, HTTP method and header information to OSS to decide whether to send a real request before sending a cross-domain request.
Request Method
POST
Request Path
/apsara/route/OneRouter/OptionObject
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
Origin | BODY | string | Yes | http://www.example.com | request source field, used to mark cross-domain requests. Default value: None |
Access-Control-Request-Method | BODY | string | Yes | PUT | indicates the method that will be used in the actual request. Default value: None |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
Access-Control-Request-Headers | BODY | string | Yes | x-oss-test | indicates the header other than the simple header used in the actual request. Default value: None |
version | BODY | string | No | 2016-01-01 | version of api |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
Access-Control-Expose-Headers | string | Content-Length | list of headers allowed to be accessed in the client JavaScript. |
Access-Control-Allow-Origin | string | http://www.example.com | Origin included in the request. If the request is not allowed, the response header does not contain the header. |
Access-Control-Allow-Methods | string | PUT | HTTP methods that allow requests. If the request is not allowed, the response header does not contain the header. |
Access-Control-Max-Age | integer | 100 | The time when the browser is allowed to cache preflight results, in seconds. |
Access-Control-Allow-Headers | string | x-oss-test | list of headers allowed to be carried by the request. If the request contains an unallowed header, the header is not included and the request is rejected. |
Example
Successful Response example
{
"Access-Control-Expose-Headers":"Content-Length",
"Access-Control-Allow-Origin":"http://www.example.com",
"Access-Control-Allow-Methods":"PUT",
"Access-Control-Max-Age":"100",
"Access-Control-Allow-Headers":"x-oss-test"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}