title: $.ajax Where is req.data?
body: <p>I am using node.js. It's a fairly simple file arrangement on a local server.</p>
  
  <pre><code>&lt;h3&gt;To Do!&lt;/h3&gt;
  &lt;ol class="pending&gt;
  &lt;li&gt;&lt;a class="pending_task" href="localhost://nextstep.html"&gt;Task Three&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a class="pending_task" href="localhost://nextstep.html"&gt;Task Five&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a class="pending_task" href="localhost://nextstep.html"&gt;Task Six&lt;/a&gt;&lt;/li&gt;
  &lt;/ol&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;h3&gt;Completed!&lt;/h3&gt;
  &lt;ol class="completed"&gt;
  &lt;li&gt;&lt;a class="completed_task" href="localhost://nextstep.html"&gt;Task One&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a class="completed_task" href="localhost://nextstep.html"&gt;Task Two&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a class="completed_task" href="localhost://nextstep.html"&gt;Task Four&lt;/a&gt;&lt;/li&gt;
  &lt;/ol&gt;
  </code></pre>
  
  <p>Are lists on the same page. I finally have the ajax call working as desired, and now I am in the newest glitch.</p>
  
  <p>The $.ajax redirects to the proper url and the connect is made, but there is no data when I do a <code>console.log(req.data)</code></p>
  
  <p>The AJAX call:</p>
  
  <pre><code>var newData = "&lt;ol class=\"pending\"&gt;" + $('ol.pending').html() + 
              "&lt;/ol&gt;" + "&lt;ol class=\"completed\"&gt;" + $('ol.completed').html() + "&lt;\ol&gt;";
  
          $.ajax({
              method:'POST',
              data: newData,
              url: ajax_url,
              success: function(result, status, jqxhr){
                  console.log("Response: " + jqxhr.responseText);
                  console.log("POST status: " + status);
              },
              dataType: 'html',
          });
  </code></pre>
  
  <p>The app.js</p>
  
  <pre><code>http.createServer(function(req, res){
    if ((req.method === 'POST') &amp;&amp; (req.url === '/result')){
          console.log("Request Data: " + req.data);
          res.statusCode = 200;
          res.end("Message Received!");
    }
   }).listen(port, serverURL);
  </code></pre>
  
  <p>My intended result is to rewrite the originating file with the new arrangement of completed/pending, after writing the old arrangement to a new file name (TODO_date_time.html), which I can't do yet because the generated data, passed to the AJAX call is not being transmitted. Or I am not accessing it preoperly.</p>
  
  <p>What I get though is:</p>
  
  <pre><code>[nodemon] starting `node app.js`
  Starting Web Server at local:4000
  Request Data: undefined
  </code></pre>
  
  <p>The console.log in the browser is all good:</p>
  
  <p><a href="https://i.stack.imgur.com/h6Jzc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h6Jzc.png" alt="Browser console.log"></a></p>
  
  <p>Not sure what's wrong with my work at this point.</p>