gpt4 book ai didi

java - 为什么我的服务器响应状态代码是 200 而不是 200 ok?

转载 作者:可可西里 更新时间:2023-11-01 16:27:54 25 4
gpt4 key购买 nike

我通过 spring boot 创建了一个 Web 应用程序.但我发现响应状态代码是200

enter image description here

而不是 200 ok

enter image description here .

我用 return new ResponseEntity<>("xx",HttpStatus.OK); , 响应代码也是 200 .

最佳答案

“其他应用程序”有问题。来自 RFC 2616 :

6.1.1 Status Code and Reason Phrase

The Status-Code element is a 3-digit integer result code of the attempt to understand and satisfy the request. These codes are fully defined in section 10. The Reason-Phrase is intended to give a short textual description of the Status-Code. The Status-Code is intended for use by automata and the Reason-Phrase is intended for the human user. The client is not required to examine or display the Reason- Phrase.

添加了强调。 “其他应用程序”是一个自动机,而不是人类用户,因此应该只查看状态代码。

关于java - 为什么我的服务器响应状态代码是 200 而不是 200 ok?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45316486/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com