I have ISO-8859-1 database, so I like to exchange requests entirely in this codepage. So, how to set content-type for AJAX requests in the right way?
Even though it's bad to do (bunch of comments above), this would work:
var xhr = new XMLHttpRequest(); xhr.open("GET", path, false); xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=ISO-8859-1')
If you are using jQuery: https://stackoverflow.com/a/553572/2527433
1.4m articles
1.4m replys
5 comments
57.0k users