title: Cant get request payload in express js node
body: <p>This is my Node  Express Code,</p>
  
  <pre><code>(function () {
      'use strict';
      var fs = require('fs');
      var cors = require('cors');
      var bodyParser = require('body-parser');
      var express = require('express'),
          app = express(),
          port = 8112;
  
  
      app.use(cors());
      app.use(bodyParser.urlencoded({ extended: true }));
      app.use(bodyParser.json());
      app.listen(port);
  
  
      app.route('/abc')
          .post(abc);
  
  
      function abc(req,res){
          console.dir(req.body);
          res.header("Access-Control-Allow-Origin", "*");
          res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
          res.sendStatus(200);
      }
  
  })();
  </code></pre>
  
  <p>But Im getting request body as </p>
  
  <blockquote>
    <p>{}</p>
  </blockquote>
  
  <p>But in my network Tab in Chrome I can see request payload.
      Please note OPTIONS is fired before this POST call.</p>
  
  <p>Request headers</p>
  
  <blockquote>
    <p>POST /abcHTTP/1.1 Host: localhost:8112 Connection:<br>
    keep-alive Content-Length: 11 Pragma: no-cache Cache-Control: no-cache<br>
    Origin: <a href="http://localhost:4200" rel="noreferrer">http://localhost:4200</a> User-Agent: Mozilla/5.0 (Windows NT
    10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)  Chrome/66.0.3359.181 Safari/537.36<br>
    x-api-key:CExkxDlFC35ckfCGX6m61x76GxIYH2h2Iv8bX874<br>
    Content-Type:text/plain;charset=UTF-8<br>
    Accept: <em>/</em> Referer:
    <a href="http://localhost:4200/dashboard" rel="noreferrer">http://localhost:4200/dashboard</a> 
    Accept-Encoding: gzip, deflate, br<br>
    Accept-Language: en-US,en;q=0.9  </p>
  </blockquote>
  
  <p><strong>Request Payload</strong></p>
  
  <blockquote>
    <p>{"dd":"dd"}</p>
  </blockquote>