putString method

Future<bool> putString(
  1. String key,
  2. String data, {
  3. String? contentType,
  4. S3Acl? acl,
})

Uploads a string to S3.

When contentType is omitted, it defaults to text/plain.

Example:

final ok = await client.putString(
  'logs/run.txt',
  'Job completed',
);

Implementation

Future<bool> putString(String key, String data, {String? contentType, S3Acl? acl}) async {
  return putObject(key: key, data: utf8.encode(data), contentType: contentType ?? 'text/plain', acl: acl);
}