Open anacrolix opened 9 years ago
Does this method do what you want? https://godoc.org/github.com/mitchellh/goamz/s3#Bucket.Head
Nah, HEAD requests are something else altogether, but thanks.
I'm looking for the same thing. Unfortunately this function doesn't allow adding path or header params, and getResponseParams
is a private method.
func (b *Bucket) GetResponse(path string) (*http.Response, error) {
return b.getResponseParams(path, nil)
}
To achieve this, we need to be able to set custom headers on GET requests. ""The S3 APIs support the HTTP Range: header (see RFC 2616), which take a byte range argument. Just add a Range: bytes=0-NN header to your S3 request""
To add this functionality along with other custom functionality, adding GetReaderHeader
which is similar to PutReaderHeader
should solve this issue and be flexible enough for users to provide whatever headers they want.
S3 purported supports Range requests, but there's no way to specify these in Bucket.Get and friends. Perhaps a GetHeader method or similar is required?