title: getting server 500 internal error but working fine in postman
body: <p>Everything seems fine. I had checked with the JSON validator also the
  type of data we are  passing is valid. However I am getting the following error </p>
  
  <blockquote>
    <p>POST <a href="http://xx.xxx.xxx.xxx:3001/createData" rel="nofollow noreferrer">http://xx.xxx.xxx.xxx:3001/createData</a> 500 (Internal Server Error) jquery.min.js:2</p>
  </blockquote>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"&gt;&lt;/script&gt;
  
  &lt;h2&gt;HTML Forms&lt;/h2&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form  name = "test_form"  method="post"&gt;
    First name:&lt;br&gt;
    &lt;input type="text" name="firstname" value="Mickey"&gt;
    &lt;br&gt;
    Last name:&lt;br&gt;
    &lt;input type="text" name="lastname" value="Mouse"&gt;
    &lt;br&gt;&lt;br&gt;
    &lt;input type="button" onclick="goodCall()" value="Submit" &gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;p&gt;If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".&lt;/p&gt;
  &lt;script&gt;
  function goodCall() {
      //var url = http://34.201.147.118:3001/createData
  
      var data = {
        "productID": document.test_form.firstname.value,
        "title": document.test_form.lastname.value,
      }
      dataset = JSON.stringify(data)
      console.log(typeof dataset);
      console.log(dataset);
      $.ajax({
    type: "POST",
    url: "http://34.201.147.118:3001/createData",
    data: dataset,
    success: alert("your data has been sucefull posted"),
    dataType:  'application/json',
  });
    };
  
  
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my output   </p>
  
  <p>string</p>
  
  <p>stackoverflow.html:29 
  {"productID":"Mickey","title":"Mouse"}<br>
     next i am getting the error</p>
  
  <pre><code>  jquery-3.3.1.min.js:2 POST http://34.201.147.118:3001/createData 500 (Internal Server Error)
      send @ jquery-3.3.1.min.js:2
      ajax @ jquery-3.3.1.min.js:2
      goodCall @ stackoverflow.html:30
      onclick @ stackoverflow.html:15
  </code></pre>