The magic happens in line 5, which overrides the MIME type, forcing the browser to treat it as plain text, using a user-defined character set. You just need to add your files to the form-data. How to pass multiple JSON Objects as data using jQuery's $.ajax() ? Make it File and upload your file. Also, there is an additional event type a POST request can trigger compared to a GET request. These methods are the FetchAPI, based on JavaScript promises, and XMLHttpRequest, based on callbacks. Useful tutorials, guides, and career tips for developers, delivered once a week. main page using