title: Can not set certain HTTP header key value pairs correctly in angular
body: <p>I have a issue by adding some HTTP header key value to a http.post. It should be very simple but I am not getting correctly set. We are using on server side a spring-boot and on client side angular framework.
  Our backend request the following header values:</p>
  
  <pre><code>'Content-Type' = 'application/json' 
  'X-Requested-With' = 'XMLHttpRequest' 
  'Cache-Control' = 'no-cache'
  </code></pre>
  
  <p>In angular, I create a header, this header I add a RequestOptions and add this options to the post request.
  See code below:</p>
  
  <pre><code>.....
      let myHead = new Headers();
      myHead.append('Content-Type', 'application/json');
      myHead.append('X-Requested-With', 'XMLHttpRequest');
      myHead.append('Cache-Control', 'no-cache');
      const options = new RequestOptions({ headers: myHead });
  
      return this.http.post(ServerUrl,data, options).map((response: Response) =&gt; {..//do Something...}
  
  ...
  </code></pre>
  
  <p>The problem is, if I am checking the post request, I see that the header is not correctly set. 
  <a href="https://i.stack.imgur.com/nOFPk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nOFPk.png" alt="enter image description here"></a></p>
  
  <p>As you can see above it is not correctly set as a key value as I am expecting!?</p>
  
  <p>If I do this with a tool e.g. postman plugin you see how it should be done corretly:</p>
  
  <pre><code>POST /ias-vwa/api/auth/login HTTP/1.1
  Host: de00-fm26-l1:9090
  Content-Type: application/x-www-form-urlencoded
  X-Requested-With: XMLHttpRequest
  Cache-Control: no-cache
  Postman-Token: c9bc0404-bc1e-57eb-fca4-07bba9ee6d93
  </code></pre>
  
  <p>I tried a lot of different options to set the header but I was always ending up that it will be always set in one line like this:</p>
  
  <p><strong>Access-Control-Request-Headers:access-control-allow-origin,cache-control,content-type,x-requested-with</strong></p>
  
  <p>The error I get on the browser:</p>
  
  <pre><code>XMLHttpRequest cannot load http://t00:9090/ias-vwa/api/auth/login. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 401.
  </code></pre>
  
  <p>Can any body give me a hint on that?</p>