AWS SDK V3 with R2, Receive status 200 but no data
I am using AWS SDK V3 to upload/fetch files from R2. I am testing out the CreateBucketCommand and the ListBucketsCommand. I am receiving these responses from both methods but no data:
response1= {
'$metadata': {
httpStatusCode: 200,
requestId: undefined,
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
}
}
I also added 'forcePathStyle: true' to the config which fixed the previous error of 'NoSuchBucket' when trying to create a bucket, not sure how or why I had to do that. I've also tested this with AWS S3 and it creates the buckets and lists the buckets with no problems.
The code:
Any help would be much appreciated.
0 Replies