title: How do I upload to Amazon S3 using .NET HttpClient WITHOUT using their SDK
body: <p>How do I upload a file to a bucket on Amazon S3 just using .NET's HttpClient (or WebClient)? It has to be done using "PUT".</p>
  
  <p>I can upload using Amazon's AWS SDK, but I would like to know how to do it without it. I've looked at their documentation for hours and still don't get it.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>My code using their SDK is:</p>
  
  <pre><code>public static void TestPutObjectAsync() {
          AmazonS3Client client = new AmazonS3Client();
          client.AfterResponseEvent += new ResponseEventHandler(callback);
  
          PutObjectRequest request = new PutObjectRequest {
              BucketName = BUCKET_NAME,
              Key = "Item1",
              FilePath = FILE_PATH,
          };
  
          client.PutObjectAsync(request);
  }
  
  public static event EventHandler UploadComplete;
  
  public static void callback(object sender, ResponseEventArgs e) {
  
          if (UploadComplete != null) {
              UploadComplete(sender, e);
          }
  }
  </code></pre>