简体   繁体   English

Jetty中HTTP响应的状态码中的Unicode

[英]Unicodes in statuscode of HTTP-Response in Jetty

I want to send characters like as status code. 我想发送诸如字符作为状态码。 Fe: 484 - User „me“ not found Fe: 484 - User „me“ not found

In my test-example i tried the following (i know that setStatus(int,string) is deprecated): 在我的测试示例中,我尝试了以下操作(我知道不建议使用setStatus(int,string) ):

response.setStatus(HttpServletResponse.SC_NOT_FOUND, "User „me“  not found");

What I get in the client is: User ?me? not found 我从客户端得到的是: User ?me? not found User ?me? not found . User ?me? not found

Is there a way to send those characters as statuscode in jetty? 有没有办法将这些字符作为码头上的状态码发送? My research about this was unsuccessful.. 我对此的研究没有成功。

I'm using jetty 9.4.3. 我正在使用码头9.4.3。

No, the behavior for non-ASCII characters is essentially undefined. 不,非ASCII字符的行为基本上是不确定的。

Furthermore, the reason phrase does not exist in HTTP/2, so I wouldn't build any functionality on it. 此外,原因短语在HTTP / 2中不存在,因此我不会在其上构建任何功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM