title: The post request works in Postman and in cURL but not in Angular
body: <p>I have a remote server and a local client which sends a simple post request with one header <code>Content-Type: application/json</code> and with the body  <code>'{&quot;text&quot;: &quot;hello&quot;}'</code>.</p>
  <p>The server code is here. It prints the request body and the header.</p>
  <pre><code>import * as express from 'express';
  import * as bodyParser from &quot;body-parser&quot;;
  
  const app = express();
  const router = express.Router();
  
  router.route(&quot;/home&quot;)
      .all(bodyParser.json())
      .all(function (req, res, next) {
          console.log(req.body, req.headers['content-type']); // !!! print to console body and header
          next(); 
      })
      .post( (req, res, next) =&gt; {
          res.status(200).json({
                      message: req.body,
                  })
              }
      );
  
  app.use((req, res, next) =&gt; {
      res.header(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;);
      res.header(&quot;Access-Control-Allow-Headers&quot;, &quot;Origin, X-Requested-With, Content-Type, Accept&quot;);
      res.header(&quot;Access-Control-Allow-Methods&quot;, &quot;GET, PATCH, PUT, POST, DELETE, OPTIONS&quot;);
      next();
  });
  app.use('/api/v1', router);
  
  app.listen(3000, function(){
      console.log('listening on 3000');
  });
  </code></pre>
  <p>The post request works fine from Postman and from curl.</p>
  <pre><code>curl --location --request POST 'http://vm-gudiea.sio.lab.emc.com:3000/api/v1/home' --header 'Content-Type: application/json' --data-raw '{\&quot;text\&quot;: \&quot;hello\&quot;}'
  </code></pre>
  <p>For both requests the server prints the following body and <code>content-type</code> header.</p>
  <pre><code>{ text: 'hello' } 'application/json'
  </code></pre>
  <p>But I need to send the request from my Angular app. I have the following method in a service there</p>
  <pre><code>sendInitialRequest(): void {
      const myHeaders = new HttpHeaders().set('Content-Type', 'application/json');
      this.http.post(this.remoteUrl, JSON.stringify({text: 'hello'}), {headers: myHeaders})
        .subscribe(data =&gt; console.log(data));
    }
  </code></pre>
  <p>But if I call the method remote server will print the output</p>
  <pre><code>{} undefined
  </code></pre>
  <p>So it didn't get a <code>Content-Type</code> header and body for some reason. Where is the bug here? How can I send a post request with body and header from an Angular app ?</p>