monstervivi's recent timeline updates
monstervivi

monstervivi

V2EX member #360834, joined on 2018-11-05 08:55:11 +08:00
Today's activity rank 22142
Per monstervivi's settings, the topics list is hidden
Deals info, including closed deals, is not hidden
monstervivi's recent replies
Oct 3, 2024
Replied to a topic by misaka00251 全球工单系统 神秘的 Duolingo 访问问题
好像是按照时区判断的
@monstervivi

修正: 应该是加上 produces ,例如 @GetMapping(value = "x", produces = "application/json;charset=UTF-8")
不过如果要修改,应该也不用修改 Spring 的 MessageConverter 吧?

@RequestMapping 注解,可以加上 consumes 值呀,例如: @GetMapping(value = "x" consumes = "*/*")
HTTP 响应 Body ,当然是以 Request Header 中的 Accept 字段来准 ,这就是 HTTP 规范呀。

而且 Spring Web 处理响应 Body 就是按照 Accept 字段来分不同逻辑来处理。

参考 [AbstractMessageConverterMethodProcessor#writeWithMessageConverters]( https://github.com/spring-projects/spring-framework/blob/main/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java#L224C1-L224C1)

连 Spring 都是按此来作为标准,所以我认为这就是标准做法。
Raycast


刚找到讲解 DNS 代理的资料,希望可以帮到你。
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   964 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 20:49 · PVG 04:49 · LAX 13:49 · JFK 16:49
♥ Do have faith in what you're doing.