feat: read response from 201 on file upload

This commit is contained in:
Rohan Verma
2018-12-26 13:36:35 +05:30
parent e4c7d93da1
commit 8079b244c7
4 changed files with 71 additions and 14 deletions
+5 -1
View File
@@ -24,9 +24,13 @@ s3 := simples3.New(Region, AWSAccessKey, AWSSecretKey)
// obtain credentials from IAM attached to the instance.
s3 := simples3.NewUsingIAM(Region)
// Note: Consider adding a testTxt.Seek(0, 0)
// in case you have read
// the body, as the pointer is shared by the library.
// File Upload is as simple as providing the following
// details.
err := s3.FileUpload(simples3.UploadInput{
resp, err := s3.FileUpload(simples3.UploadInput{
Bucket: AWSBucket,
ObjectKey: "test.txt",
ContentType: "text/plain",