[英]Why my server response status code is 200 instead of 200 ok?
I created a web application by spring boot
.But i find the response status code is 200
我通过spring boot
创建了一个Web应用程序。但是我发现响应状态码是200
instead of 200 ok
而不是200 ok
And i use return new ResponseEntity<>("xx",HttpStatus.OK);
我使用return new ResponseEntity<>("xx",HttpStatus.OK);
,the response code is also 200
. ,响应代码也是200
。
The 'other application' is at fault. “其他应用程序”有故障。 From RFC 2616 : 从RFC 2616 :
6.1.1 Status Code and Reason Phrase 6.1.1状态码和原因短语
The Status-Code element is a 3-digit integer result code of the attempt to understand and satisfy the request. Status-Code元素是3位数的整数结果代码,用于尝试理解和满足请求。 These codes are fully defined in section 10. The Reason-Phrase is intended to give a short textual description of the Status-Code. 这些代码在第10节中有完整定义。原因短语旨在简要说明状态代码。 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. 不需要客户检查或显示原因短语。
Emphasis added. 重点已添加。 The 'other application' is an automaton, not a human user, and therefore should only be looking at the Status-Code. “其他应用程序”是自动机,不是人工用户,因此应仅查看状态码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.