The problem with posting values to an endpoint directly from an online form is that they sent as strings. This means you have to coerce the values to the proper type after they are submitted. An easy way to do this is by using a try...catch block and JSON.parse on the submitted values.

The example below uses an ExpressJS endpoint...

app.get('/save-form', function(req, res) {  
  for (field in req.body) {
    try {
      req.body[field] = JSON.parse(req.body[field]);
    } catch (e) {
      // The value is already a string, so do nothing...

If you want a string representation of a boolean or number, simply wrap those values in double quotes before parsing.

function wrapValue(value) {  
  return '"' + value + '"';

req.body[field] = wrapValue(req.body[field]);  

When the wrapped value is parsed, it will return as a string. This is important for things like a zipcode that might begin with a 0 or something similar.