Open radiovisual opened 8 years ago
I am simply trying to do a head request to check the existence of an S3 Bucket.
If I were using the aws-sdk, I would use the aws-sdk's headObject method and do this:
headObject
var AWS = require('aws-sdk'); var s3 = new AWS.S3(); s3.headObject({Bucket: 'someBucket'}, function(err, data) { if (err) { console.log(err, err.stack); } else { console.log('The bucket exists!'); } });
I see that knox has a client.head() method, which seems to need a path to a file, like this:
client.head()
client.head('path/to/file').on('response', function (res) { // ... });
But is there a way to use knox to just grab the HEAD of a bucket?
Something like:
client.head('bucketName').on('response', function (res) { // ... });
Thanks!
I am simply trying to do a head request to check the existence of an S3 Bucket.
If I were using the aws-sdk, I would use the aws-sdk's
headObject
method and do this:I see that knox has a
client.head()
method, which seems to need a path to a file, like this:But is there a way to use knox to just grab the HEAD of a bucket?
Something like:
Thanks!