You can use a PutObjectRequest to easily configure your PUT rest method.
Example code:
val put = PutObjectRequest(configuration.bucketName, uploadFileName, fileToUpload)
put.withCannedAcl(CannedAccessControlList.PublicRead)
amazonS3.putObject(put)
If you want to add some metadata to the HTTP Request then you can create a MetadataObject and add information like headers and content encoding, length, etc...
val objectMetadata = ObjectMetadata()
objectMetadata.setHeader("x-amz-acl", "public-read")
put.withMetadata(objectMetadata)
You can use a
PutObjectRequest
to easily configure yourPUT
rest method.Example code:
If you want to add some metadata to the HTTP Request then you can create a
MetadataObject
and add information like headers and content encoding, length, etc...References
Bluemix Cloud Object Storage Amazon PUT object