title: Creating an Amazon S3 Bucket using jQuery and REST
body: <p>I am wanting to try and do a handful of things with the use of jQuery and Amazons S3 API via REST. My key issue is not being familiar with REST well enough (or not as well as I thought I knew) to know if this approach would even remotely work right. I have tried searching endlessly for some tidbit of an example and came up fruitless, maybe I am searching for the wrong things I don't know, but as a last ditch effort I figured I'd hit up my new favorite place, here..</p>
  
  <p>What I need to do is send. PUT a request to the API to create the bucket. Based on the S3 API docs I came up with</p>
  
  <pre><code>var AWSAccessKeyId = "";
  var AWSSecretAccessKey = "";
  var AWSDomain = ".s3.amazonaws.com";
  
  function createNewBucket(bucketName)
  {
      var bucketString = 'HTTP/1.1\n';
      bucketString += bucketName + AWSDomain + '\n';
      bucketString += 'Content-Length: 0 \n';
      bucketString += 'Date: Wed, 01 Mar  2009 12:00:00 GMT \n';
      bucketString += 'Authorization: AWS ' +  sha1_string;
  
      $.ajax({
          url: bucketName + AWSDomain,
          type: 'PUT',
          data: bucketString,
          success: function(data) 
          {
  
          },
          error: ''
      });
  }
  </code></pre>
  
  <p>though concept isn't complete with the above I am just starting it out, and I started questioning if this idea of approach was even going to work.. And if it is to work with the above or in any means provided here for help how would I also work with the response to know if it was successful or not? I know if I can nail this one piece down I can handle for the most part the rest of my issues to come. Its just tackling the first hump and figuring out if I am going about it the right way. Its also worth mentioning that I have been tasked with doing this purely javascript style with or without the help of a lib like jquery. I can't use PHP, or the like in this concept. So if anyone can throw me a bone i'd be greatly appreciative. </p>
  
  <p>On a side note, does anyone know if theres a means of actually testing something like this stuff out without actually having a S3 account, cause I can't afford to pay for an account just for the sake of testing let alone any other reason.</p>