title: Req.body is Undefined while Post request through Fetch Api
body: <p>When I  try to call the POST Api through fetch method by passing the parameter in body then I got req.body undefined on backend side(Node js side).Also when I call the Same POST api through Postman by passing the parameter in body then It work successfully(I got the req.body). backend is in node js and Front end is in React js. Any help will be appreciated.</p>
  
  <p><a href="https://i.stack.imgur.com/PFJHM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PFJHM.png" alt="Node Backend log"></a>
  <a href="https://i.stack.imgur.com/nTAvD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nTAvD.png" alt="Browser console log"></a>
  <a href="https://i.stack.imgur.com/gOj1h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gOj1h.png" alt="Network console in browser"></a>
  <a href="https://i.stack.imgur.com/kTdBA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kTdBA.png" alt="Network console  in browser"></a></p>
  
  <pre><code>
  import React, { Component } from 'react'
  import '../Css/Login.css'
  
  export class Login extends Component {
  
      constructor(props) {
          super(props)
  
          this.state = {
              name: "",
              password: ""
          }
  
          this.onChange = this.onChange.bind(this);
      }
  
      submitHandler = (e) =&gt; {
          e.preventDefault();
          console.log(this.state);
          try {
  
              let result = fetch('http://localhost:4000/users/login', {
                  method: 'POST',
                  mode: 'no-cors',
                  headers: {
                      'Content-Type': 'application/json',
                      'Accept': 'application/json'
  
                  },
                  body: { name: this.state.name, password: this.state.password }
              })
  
              result.then((sucess) =&gt; { console.log(sucess) })
          } catch (error) {
              console.log(error)
  
          }
  
  
  
      }
  
      onChange(e) {
          this.setState({ [e.target.name]: e.target.value })
  
      }
      render() {
          return (
              &lt;div&gt;
                  &lt;div className="LoginPage"&gt;
                      &lt;div class="container Login_div"&gt;
                          &lt;div className="Admin_panel"&gt;&lt;h2&gt;Admin Panel&lt;/h2&gt;&lt;/div&gt;
  
                          &lt;form onSubmit={this.submitHandler}&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;label for="email"&gt;Email:&lt;/label&gt;
                                  &lt;input type="text" name="name" class="form-control" placeholder="Enter email" onChange={this.onChange} /&gt;
                              &lt;/div&gt;
                              &lt;div class="form-group"&gt;
                                  &lt;label for="pwd"&gt;Password:&lt;/label&gt;
                                  &lt;input type="password" name="password" class="form-control" placeholder="Enter password" onChange={this.onChange} /&gt;
                              &lt;/div&gt;
  
                              &lt;button type="submit" class="btn btn-login"&gt;Submit&lt;/button&gt;
                          &lt;/form&gt;
                      &lt;/div&gt;
  
                  &lt;/div&gt;
              &lt;/div&gt;
          )
      }
  }
  
  export default Login
  </code></pre>