title: Get Classic ASP variable from posted JSON
body: <p>I'm trying to post JSON via AJAX to a Classic ASP page, which retrieves the value, checks a database and returns JSON to the original page.</p>
  
  <p>I can post JSON via AJAX.  I can return JSON from ASP.  I can't retrieve the posted JSON into an ASP variable.</p>
  
  <p>POST you use Request.Form, GET you use Request.Querystring.  What do I use for JSON?</p>
  
  <p>I have JSON libraries but they only show creating a string in the ASP script and then parsing that. I need to parse JSON from when being passed an external variable.</p>
  
  <p>Javascript</p>
  
  <pre><code>var thing = $(this).val();
  
  $.ajax({
           type: "POST",
           url: '/ajax/check_username.asp',
           data: "{'userName':'" + thing + "'}",
           contentType: "application/json; charset=utf-8",
           dataType: "json",
           cache: false,
           async: false,
           success: function() {
              alert('success');
           }
  });
  </code></pre>
  
  <p>ASP file (check_username.asp)</p>
  
  <pre><code>    Response.ContentType = "application/json"
            sEmail = request.form() -- THE PROBLEM
  
            Set oRS = Server.CreateObject("ADODB.Recordset")
            SQL = "SELECT SYSUserID FROM dbo.t_SYS_User WHERE Username='"&amp;sEmail&amp;"'" 
            oRS.Open SQL, oConn
            if not oRS.EOF then 
              sStatus = (new JSON).toJSON("username", true, false)
            else
              sStatus = (new JSON).toJSON("username", false, false)
          end if
  response.write sStatus
  </code></pre>