title: Is it possible to set HTTP POST request body message via Javascript?
body: <p>I'm building REST web app and my server side Java code expects request body to have pure JSON string. 
  My goal is to use regular HTTP POST method (not ajax) and set JSON into request body message.</p>
  
  <p>If I use ajax, it is very simple. Something like:</p>
  
  <pre><code>var jsonInput = '{"foo":"bar"}';
  ajaxRequest.setRequestHeader("Content-Type", "application/json");
  ajaxRequest.send(jsonInput)
  </code></pre>
  
  <p>But I want to use regular HTTP POST.</p>
  
  <p>Looking at the thread below, the answer is to create a form with hidden input field and put JSON in to the input field and have server side code handle the rest.</p>
  
  <p><a href="https://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit">JavaScript post request like a form submit</a></p>
  
  <p>I tried that and it works just fine but <strong>do I really have to bother creating new form and input field to accomplish this? Or is there any other way available?</strong></p>
  
  <p>NOTE: I don't want to use JQuery or Prototype framework. Just simple Javascript.</p>