title: POST data in JSON format
body: <p>I have some data that I need to convert to JSON format and then POST it with a JavaScript function.</p>
  
  <pre><code>&lt;body onload="javascript:document.myform.submit()"&gt;
  &lt;form action="https://www.test.net/Services/RegistrationService.svc/InviteNewContact" method="post" name="myform"&gt;
    &lt;input name="firstName" value="harry" /&gt;
    &lt;input name="lastName" value="tester" /&gt;
    &lt;input name="toEmail" value="testtest@test.com" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>This is the way the post looks now. I need it submit the values in JSON format and do the POST with JavaScript.</p>