Closed
Description
How to send a file or formdata with jQuery is brought up a lot at StackOverflow
I think you should do things better by trying to understand what kind of data they are sending without having to do processData = false
and contentType = false
that is why i propose this should be possible
jQuery.ajax({
url: url,
method: 'POST',
data: FormData || typed arrays || Blob || File || UrlSearchParams
// without the need of this:
// processData: false,
// contentType: false
});
// and also
jQuery.post(url, FormData || typed arrays || Blob || File || UrlSearchParams)
What i usually do is propose using the fetch api instead of jquery's ajax, this is something that you don't make any easier for the developers, it's quite the opposite. It makes it harder and more confusing to why things don't work