title: Parameter retrieval for HTTP PUT requests under IIS5.1 and ASP-classic?
body: <p>I'm trying to implement a REST interface under IIS5.1/ASP-classic (XP-Pro development box).  So far, I cannot find the incantation required to retrieve request content variables under the PUT HTTP method.</p>
  
  <p>With a request like:</p>
  
  <pre><code>PUT http://localhost/rest/default.asp?/record/1336
  
  Department=Sales&amp;Name=Jonathan%20Doe%203548
  </code></pre>
  
  <p>how do I read <code>Department</code> and <code>Name</code> values into my ASP code?</p>
  
  <p><code>Request.Form</code> appears to only support POST requests.  <code>Request.ServerVariables</code> only gets me to header information.  <code>Request.QueryString</code> doesn't get me to the content either...</p>
  
  <hr>
  
  <p>Based on the replies from AnthonyWJones and ars I went down the BinaryRead path and came up with the first attempt below:</p>
  
  <pre><code>var byteCount = Request.TotalBytes;
  var binContent = Request.BinaryRead(byteCount);
  var myBinary = '';
  
  var rst = Server.CreateObject('ADODB.Recordset');
  rst.Fields.Append('myBinary', 201, byteCount);
  rst.Open();
  rst.AddNew();
  rst('myBinary').AppendChunk(binContent);
  rst.update();
  var binaryString = rst('myBinary');
  var contentString = binaryString.Value;
  
  var parameters = {};
  var pairs = HtmlDecode(contentString).split(/&amp;/);
  for(var pair in pairs) {
      var param = pairs[pair].split(/=/);
      parameters[param[0]] = decodeURI(param[1]);
  }
  </code></pre>
  
  <p><a href="http://blogs.msdn.com/david.wang/archive/2006/07/04/HOWTO-Convert-between-JScript-Array-and-VB-Safe-Array.aspx" rel="nofollow noreferrer">This blog post by David Wang</a>, and an <code>HtmlDecode()</code> function taken from Andy Oakley at blogs.msdn.com, also helped a lot.</p>
  
  <p>Doing this splitting and escaping by hand, I'm sure there are a 1001 bugs in here but at least I'm moving again.  Thanks.</p>