I'm using FormData to send some data to my server
submit.click(function (event) {
event.preventDefault();
let formData = new FormData();
//filling data
}
and then I would like to use $.post()
to send my form to the server in this way
$.post('CreateProduct', formData);
But it doesn't work and I receive this exception
Otherwise when I post my data with $.ajax
it works perfectly
$.ajax({
url: 'CreateProduct',
data: formData,
processData: false,
contentType: false,
type: 'POST'
});
Is it any opportunity to use $.post
instead of $.ajax
? Am I miss something??