I have a form that performs the following function in JS:
function makeNewSkill() {
var formData = new FormData(document.querySelector('form'))
var req = new XMLHttpRequest();
req.open("post", url);
req.send(formData);
}
I have confirmed that the form is sending data. On the Spark side, the data is reaching the server, but not in the queryParams (its empty). The only place I could find the data was in request.body(). When I run:
post("/myUrl") { req, res ->
System.out.println(req.body());
}
I have a form that performs the following function in JS:
I have confirmed that the form is sending data. On the Spark side, the data is reaching the server, but not in the queryParams (its empty). The only place I could find the data was in request.body(). When I run:
I get:
Am I doing something wrong or are parameters not parsed if they are sent through an XMLHttpRequest with a Content-type of FormData?