title: HTTP request, content-type missing
body: <p>I've created XMLHttpRequest:</p>
  
  <pre><code>var body = "{cos: test}";
  
        this.XHRhttp.open("POST", "https://10.222.1.170:8600");
        this.XHRhttp.onreadystatechange = this.readyState.bind(this);
        this.XHRhttp.setRequestHeader("accept", "*/*");
        this.XHRhttp.setRequestHeader("content-type", "application/json");
  
        this.XHRhttp.send(body);
  </code></pre>
  
  <p>When I try to send a content-type header, the server responds by saying the header doesn't exist.</p>
  
  <p>But, when I remove the content-type, the server receives "text/plain;charset=UTF8".
  Why is my content-type header not being sent?</p>
  
  <p>Server side:</p>
  
  <pre><code> var securedServer = require("https").createServer(authOption, function (req, res) {
  .......
         if(req.headers["content-type"] !== "application/json")
         {
            opt.statusCode = 405;
            opt.statusMsg = "Wrong Content-Type";
            opt.body = "Only application/json Content-Type allowed";
            RespondToClient(res, opt);
            return;
         }
  
      .............
      }
  
  function RespondToClient(res, opt)
  {
     res.writeHead(opt.statusCode, opt.statusMsg, {
        "Access-Control-Allow-Origin": opt.headerOrigin,
        "Access-Control-Allow-Methods": "POST",
        "Access-Control-Allow-Headers": "content-type",
        'Content-Type': opt.contentType,
        "Content-Length": opt.body.length,
        "Connection": "Close"
     });
     res.shouldKeepAlive = false;
     res.end(opt.body, "utf8");
  }
  </code></pre>