-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
Description
I am trying to use the S3 API. I tried both ListObjects and GetObjects.
For both, the result is the same - the answer from the server is not the one expected:
<?xml version="1.0" encoding="UTF-8"?>
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
...
</ListAllMyBucketsResult>Vs
<?xml version="1.0" encoding="UTF-8"?>
<GetObjectOutput>
...
</GetObjectOutput>Here is the code I use:
let downloadFile = (filename) => {
let settings = Config.settings;
let run_request =
Aws_lwt.Runtime.run_request(
~access_key=settings.accessKey,
~secret_key=settings.secretKey,
~region=settings.region,
(module Aws_s3.GetObject),
Aws_s3.Types.GetObjectRequest.make(
~bucket=settings.bucket,
~key=filename,
(),
),
);
Lwt_main.run(run_request);
};Where settings.bucket = "bucket-name" and settings.region = "us-east-1".
When reading the documentation, I am under the impression that the host endpoint to target should be:
bucket-name.s3.amazonaws.com, but from what I see, the library targets s3.amazonaws.com, which might explain issue.
vbmithr