It's difficult to determine without more information provided. If the form is submitted directly (and not through AJAX), the data will likely come from input
/select
elements with corresponding names, such as:
<form method="POST" action="/express/endpoint">
<input type="text" name="firstName" />
<input type="text" name="lastName" />
<input type="submit" />
</form>
Alternatively, you can manually send this data via an AJAX request:
fetch('/express/endpoint', {
body: JSON.stringify({ firstName: 'foo', lastName: 'bar' }),
headers: {
'content-type': 'application/json'
},
method: 'POST'
}).then(function(response) {
console.log(response)
})