0

Here is my AJAX call:

$.ajax({
    method: "post",
    url: $('#tForm').attr('action'),
    contentType: "application/x-www-form-urlencoded;charset=windows-1250",
    data: $('#tForm').serialize()
})

But upon request when I check passed headers I can see some default value:

 Content-Type: application/x-www-form-urlencoded;charset=UTF-8

How to pass this correctly?

Don't Panic
  • 13,965
  • 5
  • 32
  • 51
Oleksandr IY
  • 2,783
  • 6
  • 32
  • 53
  • Possible Duplicate: https://stackoverflow.com/questions/8285936/how-to-change-ajax-charset – Twisty Jul 01 '20 at 20:28
  • Note: *The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding.* Might try Headers or `fetch()` alternative. – Twisty Jul 01 '20 at 20:29
  • @Twisty The accepted answer there says to do what he's doing. – Barmar Jul 02 '20 at 01:42

0 Answers0