title: Express.json() Not Working in version 4.17.1
body: <p>I'm trying to learn the MEAN stack I just want to perform the CURD operation. But when I send data in the request body from angular to server I received an empty request body. I don't have any idea where I'm going wrong.</p>
  <p>Here is my code</p>
  <p><strong>Route</strong></p>
  <pre><code>router.post('/create-user', async (req, res) =&gt; {
    console.log(req.body);
    let { name, email, gender, mobile_no, password } = req.body;
  
    try {
      if (
        !(name &amp;&amp; email &amp;&amp; gender &amp;&amp; mobile_no &amp;&amp; password &amp;&amp; password.length &gt; 8)
      ) {
        throw new Error(
          `All fields are required name: ${name} , email: ${email} , gender: ${gender} , MobileNo: ${mobile_no} .Password length must be greater then 8 character`
        );
      }
      password = bcrypt.hashSync(password, parseInt(process.env.BCRYPT_SALT));
  
      // let response = await USER.create({ name, email, gender, mobile_no });
      const token = await jwt.sign(
        { name, email, mobile_no, user_id: response._id },
        process.env.JWT_KEY
      );
  
      response = response.toObject();
      response['token'] = token;
  
      res.status(200).json({ err: 0, message: 'User Created', response });
    } catch (error) {
      res.status(404).json({ err: 1, message: error.message, error });
    }
  });
  
  </code></pre>
  <p><strong>Index.js</strong></p>
  <pre><code>const User = require('./Routes/user');
  
  // Using middle ware
  app.use(cors());
  app.use(
    express.urlencoded({
      extended: true,
    })
  );
  app.use(express.json());
  
  app.use('/user', User);
  
  app.listen(PORT, () =&gt; console.log(`App started on http://localhost:${PORT}`));
  
  </code></pre>
  <p><strong>Package.JSON</strong></p>
  <pre><code>{
    &quot;name&quot;: &quot;backend&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,
      &quot;start&quot;: &quot;nodemon index.js&quot;
    },
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;dependencies&quot;: {
      &quot;bcryptjs&quot;: &quot;^2.4.3&quot;,
      &quot;cors&quot;: &quot;^2.8.5&quot;,
      &quot;dotenv&quot;: &quot;^9.0.2&quot;,
      &quot;express&quot;: &quot;^4.17.1&quot;,
      &quot;jsonwebtoken&quot;: &quot;^8.5.1&quot;,
      &quot;mongoose&quot;: &quot;^5.12.9&quot;
    }
  }
  </code></pre>
  <p><strong>Angular</strong></p>
  <pre><code> create_user(data) {
      return this.http.post(`${environment.BASE_URL}/user/create-user`, data, {
        headers: { 'Content-Type': 'application/json' },
      });
    }
  
    register_user() {
      const data = this.register_form.getRawValue();
  
      let aData = new FormData();
      aData.append('name', data.name);
      aData.append('email', data.email);
      aData.append('password', data.password);
      aData.append('image', this.image);
      aData.append('gender', 'Male');
  
      // this.store.dispatch(loading({ spinner: true }));
      this.user_service.create_user(aData).subscribe(
        (res) =&gt; {
          console.log(res);
          this.store.dispatch(loading({ spinner: false }));
        },
        (error) =&gt; console.log(error)
      );
    }
  </code></pre>
  <p>If I set content-type in my request I received an error.
  is this a correct way to data into formdata?</p>
  <p><strong>Http failure response for http://localhost:4000/user/create-user: 400 Bad Request</strong></p>
  <p>Sorry if I do some silly mistake. I'm just learning</p>