简体   繁体   English

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

[英]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.

相关问题 httpclient返回登录页面而不是请求页面的响应,但返回200 ok作为状态码 - httpclient returns response of the login page and not the requested page but returns 200 ok as the status code Retrofit 响应体 null 但状态码为 200 - Retrofit response body null but status code is 200 返回200而不是204的响应代码 - Returning 200 response code instead of 204 vSphere Web服务示例失败,并显示“服务器已发送HTTP状态代码200:确定” - vSphere web-services sample fails with “The server sent HTTP status code 200: OK” RuntimeException 导致 200 OK 状态 - RuntimeException leads to 200 OK status 即使服务器出错,ResponseBuilder 也会给出 200 OK HTTP 响应 - ResponseBuilder gives 200 OK HTTP response even for server error 泽西Response.ok()不给200 OK - Jersey Response.ok() not giving 200 OK 连接到 web 服务导致 com.sun.xml.internal.ws.client.ClientTransportException:服务器发送 HTTP 状态码 200 - Connecting to webservice results in com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 200: OK Restlet获取HTTP状态代码204而不是200 - Restlet Getting HTTP Status code 204 instead of 200 改造2:response.body()为空,但状态码为200 - Retrofit 2: response.body() is null, but status code is 200
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM