0034-00000102

Updated at:

Problem description

The required Access-Control-Request-Method request header is missing from the Options request.

Causes

The Access-Control-Request-Method header is missing from the Options request.

Examples

For example, you initiate the following request:

OPTIONS /testobject HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com  
Date: Fri, 24 Feb 2012 05:45:34 GMT  
Origin:http://www.example.com
Access-Control-Request-Headers:x-oss-test1,x-oss-test2

Before sending a cross-origin request, a browser sends a preflight (OPTIONS) request to Object Storage Service (OSS). This request includes the origin, HTTP method, and header information. OSS uses this information to determine whether to allow the actual request. The Access-Control-Request-Method header specifies the HTTP method for the actual request and is required. The error occurs because this header is missing from the sample request.

Solutions

Make sure that the Origin and Access-Control-Request-Method headers are included in the request. The Origin header specifies the allowed source domain from which the request is sent. The Access-Control-Request-Method header specifies the HTTP methods the request is allowed to use.

OPTIONS /testobject HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com  
Date: Fri, 24 Feb 2012 05:45:34 GMT  
Origin:http://www.example.com
Access-Control-Request-Method:PUT
Access-Control-Request-Headers:x-oss-test1,x-oss-test2

References