title: sails.js Getting a POST payload with text/plain content type
body: <p>I'm developing a sails.js (node.js framework based on express) aplication, which is going great but ]I can't solve this detail...</p>
  
  <p>I need to send POST requests cross domain from internet explorer 8 and 9. For that I'm forced to use xDomainRequest object, wich doesn't allow to set a Content type header. </p>
  
  <p>So, when the request gets to the server the content type is "text/plain", which doesn't fire the bodyParser express middleware, so my req.body is an empty object and I can't see the payload I'm sending from the client. </p>
  
  <p>For this I've tried two things with no luck:</p>
  
  <p>First I wanted to set a header to the request in my first middleware, which is of course not available: </p>
  
  <pre><code>  req.set("Content-type", "Apli.....
  </code></pre>
  
  <p>Then, I created a middleware that listens to req.on('data'), like this:</p>
  
  <pre><code>        var data = "";
      req.on('data', function(chunk){ 
          data += chunk; 
      });
      req.on('end', function(){
         req.rawBody = data;
         next();
      });
  </code></pre>
  
  <p>But the data event never fires!</p>
  
  <p>Does anyone know how can I access my raw payload, so I can parse it myself.
  Thanks!</p>