我正在使用他们的REST API,并且试图获取存储桶位置,但没有成功。每当我尝试执行此操作时,都会收到完全相同的错误-400错误的请求(错误代码:AuthorizationHeaderMalformed)。无论我做什么我都会收到此错误。当我解析响应时,我可以看到该区域在那里。 问题是:我们是否可以选择获取存储桶区域而不会出现此错误?从他们的AWS开发工具包(PHP)中,我可以看到他们捕获了错误,然后从响应正文中获取了该区域。
* Closing connection 0
* Trying 52.218.244.186...
* TCP_NODELAY set
* Connected to servmasltest123455.s3.amazonaws.com (52.218.244.186) port 80 (#0)
> GET /?location HTTP/1.1
Host: servmasltest123455.s3.amazonaws.com
Accept: */*
User-Agent: user-agent
x-amz-date: 20190617T121859Z
x-amz-content-sha256: signature
< HTTP/1.1 400 Bad Request
< x-amz-request-id: B391493327CE3B63
< x-amz-id-2: x-amz-id
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Mon, 17 Jun 2019 12:18:59 GMT
< Connection: close
< Server: AmazonS3