HTTP headers encoding/decoding in Java

后端 未结 5 1330
我寻月下人不归
我寻月下人不归 2020-11-30 06:14

A custom HTTP header is being passed to a Servlet application for authentication purposes. The header value must be able to contain accents and other non-ASCII characters, s

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 06:46

    Again: RFC 2047 is not implemented in practice. The next revision of HTTP/1.1 is going to remove any mention of it.

    So, if you need to transport non-ASCII characters, the safest way is to encode them into a sequence of ASCII, such as the "Slug" header in the Atom Publishing Protocol.

提交回复
热议问题