在使用 java 的 http 框架发送 put 请求时,content type 设为 application/json,但是实际发送的是 application/json; charset=。
请教各位大佬,这是一种规范吗?还是一种规定呢?
1 leoleoasd 2019-02-15 12:50:42 +08:00 rfc 里写的吧 |
2 xj577 2019-02-15 13:07:26 +08:00 感觉是一种兼容性需求而非硬性规定要求,搜了下关于 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-02-15 13:40:33 +08:00 http 就是这么嗦的,实际没啥用处 |