Пример #1
0
        public static Task <PutObjectResponse> PutObjectStringAsync(this IObjectClient client, string bucketName, string objectKey, string content, Encoding?encoding = null, Action <PutObjectRequest>?config = null, CancellationToken token = default)
        {
            Validator.RequireNotNull(client, nameof(client));
            Validator.RequireNotNull(bucketName, nameof(bucketName));
            Validator.RequireNotNull(objectKey, nameof(objectKey));

            encoding ??= Constants.Utf8NoBom;

            return(client.PutObjectDataAsync(bucketName, objectKey, encoding.GetBytes(content), config, token));
        }