Example #1
0
        public void CreateBucket(string bucketName)
        {
            WebRequest webRequest = this.BuildWebRequest("PUT", bucketName, new HeaderList());

            webRequest.ContentLength = 0L;
            webRequest.GetRequestStream().Close();
            S3Response.Execute(webRequest);
        }
Example #2
0
        public S3Response put(string bucket, string key, S3Content content, HeaderList headers)
        {
            WebRequest webRequest = this.BuildWebRequest("PUT", bucket + "/" + this.EncodeKeyForSignature(key), headers);

            webRequest.ContentLength = (long)content.Bytes.Length;
            Stream requestStream = webRequest.GetRequestStream();

            requestStream.Write(content.Bytes, 0, content.Bytes.Length);
            requestStream.Close();
            return(S3Response.Execute(webRequest));
        }