title: Why is request.body is empty?
body: <p>I have been building a simple blogging app using the Mean stack and I seem to struggle, the request.body is always empty even though I send data here's the code and the request is always pending in Chrome network tab till it gives Err_connction_refused or something like that and notice that I pass form data to the service which is where the problem lies </p>
  
  <p>The Register service </p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import {Http, Headers} from '@angular/http';
  import { map } from 'rxjs/operators';
  
  @Injectable({
    providedIn: 'root'
  })
  export class RegisterService {
  
    constructor(private http: Http) { }
  // A form data is passed as an argument to this function
        register(user) {
          let headers = new Headers();
          headers.append("Content-Type", "multipart/form-data")
          return this.http.post("http://localhost:3000/api/users/register", user, {headers})
          .pipe(map(res =&gt; res.json()))
      }
  }
  </code></pre>
  
  <p>The routes in the server side-side (side-note: don't worry about the req.file.path)</p>
  
  <pre><code>// Registering a user
  router.post("/register", upload.single("profileImage") , (req, res) =&gt; {
      let newUser = new User({
          username: req.body.username,
          password: req.body.password,
          email: req.body.email,
          name: req.body.name,
          bio: req.body.bio,
          interests: req.body.interests,
          profileImage: req.body.path
      })
      User.addUser(newUser, (err) =&gt; {
          if (err) return err;
          res.send({
              success: "true",
              msg: "You've logged in sucessfully"
          })
      })
  })
  </code></pre>