6

我一直在查看 Amazons S3 服务的使用报告,并注意到 GetObject 操作需要支付 DataTransfer-out-bytes 费用(我明白这一点),而 HeadBucket 操作需要支付 DataTransfer-out-bytes 费用。

什么是 HeadBucket,这个请求是什么时候发出的?

干杯

4

1 回答 1

7

这是对存储桶的 HEAD 请求:

HEAD /my-s3-bucket

这基本上只会告诉您存储桶存在(200 OK)或不存在(404 Not Found)。

例如:

# curl -v -X HEAD http://s3.amazonaws.com/fooXXXX

* About to connect() to s3.amazonaws.com port 80 (#0)
*   Trying 72.21.211.144... connected
* Connected to s3.amazonaws.com (72.21.211.144) port 80 (#0)
> HEAD /fooXXXX HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10
> Host: s3.amazonaws.com
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< x-amz-request-id: A21BF750F080A267
< x-amz-id-2: SPQ7yX6Ln0Zgp0YULT/64ag9077nNnN25jH8PMLGMm/SbXPZ+FF3qFuiOyBfiktP
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Date: Thu, 23 Apr 2009 13:39:50 GMT
< Server: AmazonS3

比。

# curl -v -X HEAD http://s3.amazonaws.com/s3hub

* About to connect() to s3.amazonaws.com port 80 (#0)
*   Trying 72.21.207.135... connected
* Connected to s3.amazonaws.com (72.21.207.135) port 80 (#0)
> HEAD /s3hub HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10
> Host: s3.amazonaws.com
> Accept: */*
> 
< HTTP/1.1 200 OK
< x-amz-id-2: E6OvrEMD35HpJjlBg0kB90H/uaQDX8qk0oXb+baOtDKIoMXmNwgIRSX2rDE5Urlb
< x-amz-request-id: DAAAA11524A4A557
< Date: Thu, 23 Apr 2009 13:43:01 GMT
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Server: AmazonS3
< 
于 2009-04-23T13:43:52.303 回答