public PutTextObject ( string bucketName, string key, string text ) : void | ||
bucketName | string | |
key | string | |
text | string | |
리턴 | void |
public void PutTextObject(string bucketName, string key, string text)
{
var request = new PutObjectRequest
{
ContentType = "text/html",
ContentBody = text,
BucketName = bucketName,
Key = key
};
Client.PutObject(request);
}
public void DeleteObject_Should_Succeed() { // Get the client details from the stored client details (rather than embed secret keys in the test). // Ensure that your AWS/Secret keys have been stored before running. var store = new ClientDetailsStore(); AwsClientDetails clientDetails = store.Load(Container); S3Helper helper = new S3Helper(clientDetails); const string bucketName = "ExampleTestBucket"; const string key = "ExampleObject"; // Put a simple text object into the bucket to delete. helper.CreateBucket(bucketName); helper.PutTextObject(bucketName, key, "Example text to store in the object"); try { helper.DeleteObject(bucketName, key); } finally { helper.DeleteBucket(bucketName); } }