title: serving XMLHttp POST request on node js server
body: <p>Im trying to serve XMLHttprequest (POST) on node js server. </p>
  
  <p>Server side:   </p>
  
  <pre><code> app.use(bodyParser.urlencoded({extended:true}));
      app.use(bodyParser.json());
  
  
      app.post('/count', function(request, response){
        console.log(request.body);      
        response.send(request.body);    
      });
  </code></pre>
  
  <p>Client side:</p>
  
  <pre><code>&lt;script&gt;
  var xmlhttp = new XMLHttpRequest();
  var resp = ""
  xmlhttp.onreadystatechange = function() {
  if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){
          resp = xmlhttp.responseText;
          resp = JSON.parse(resp);
          document.write(resp);
          }
  }
  
  var check = "Hello";
  
  function show(){
  xmlhttp.open("POST","http://localhost:3000/count",  true);
  xmlhttp.send(JSON.stringify(check));
  &lt;/script&gt;
  </code></pre>
  
  <p>The output Im getting is   [object Object]</p>
  
  <p>Where am i going wrong?</p>