From fd83386335aa0b254f8d041ecab536a80cf572b3 Mon Sep 17 00:00:00 2001 From: heymanishjain <87717868+heymanishjain@users.noreply.github.com> Date: Sun, 8 Aug 2021 20:20:22 +0530 Subject: [PATCH] Update react-aws-s3.ts S3 accepts fetch method type as PUT only and sending POST throws error so changed the method from post to put please accept this change --- src/react-aws-s3.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react-aws-s3.ts b/src/react-aws-s3.ts index 3038f5c..7799782 100644 --- a/src/react-aws-s3.ts +++ b/src/react-aws-s3.ts @@ -37,7 +37,7 @@ class ReactS3Client { ); fd.append("file", file); - const data = await fetch(url, { method: "post", body: fd }); + const data = await fetch(url, { method: "PUT", body: fd }); if (!data.ok) return Promise.reject(data); return Promise.resolve({ bucket: this.config.bucketName,