I have an AJAX request that sends out some data. The data respects the multipart/form-data specification.
The problem I'm facing is that the browser sets the Content-Type header to text/plain and it should be multipart/form-data.
I've tried doing this: request.setRequestHeader("Content-Type", "multipart/form-data");
but this gives out an 400 Bad Request error.
If I do request.setRequestHeader("Content-Typexxxx", "multipart/form-data");
there is no error, the "Content-Typexxxx" header is set but it obviously is no help to me.
I guess there is a list of valid Content-Type headers one can set and "multipart/form-data" isn't among them, but I cannot find a sollution to my predicament.
Sample of the data actually being sent:
Content-Type: multipart/form-data; boundary=l3iPy71otz--l3iPy71otzContent-Disposition: form-data; name="titluPublic"Variation_1--l3iPy71otzContent-Disposition: form-data; name="nr_versiune"--l3iPy71otz--
Thanks!