1

When I set custom request headers for XMLHttprequest with setRequestHeader(), how will it be encoded? There must be some encoding, because JavaScript strings are utf-16, and I don't think each character is sent as 2 bytes to the server. HTTP specifies headers to be iso-8859-1 encoded. Are the headers encoded to iso-8850-1? Or are they sent as utf-8? http://www.w3.org/TR/XMLHttpRequest/ says nothing about it.

1 Answer 1

2

Meanwhile I did some tests:

Chrome v23, Linux: sends as utf-8

IE 9: sends as utf-8

FF 33, Linux: sends as iso-8859-1, does not send headers with characters outside of range

tested with äöü€

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.