在使用 java 的 http 框架发送 put 请求时,content type 设为 application/json,但是实际发送的是 application/json; charset=utf-8。
请教各位大佬,这是一种规范吗?还是一种规定呢?
1
leoleoasd 2019 年 2 月 15 日
rfc 里写的吧
|
2
xj577 2019 年 2 月 15 日
感觉是一种兼容性需求而非硬性规定要求,搜了下关于 media type 和 application/json 的 rfc,并没有规定在 json 的 content-type 里设定 charset。
RFC8259: No "charset" parameter is defined for this registration. Adding one really has no effect on compliant recipients. |
4
hilbertz 2019 年 2 月 15 日
http 就是这么啰嗦的,实际没啥用处
|