HTTP:SC_NOT_FOUND 和 NOT_FOUND 有什么区别

HTTP : What is the difference between SC_NOT_FOUND and NOT_FOUND

我正在为我的项目使用 spring,我的脑海中出现了一个问题,即这两者之间的基本区别是什么 HttpStatus

return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).body("Email address not found");

return ResponseEntity.status(HttpStatus.NOT_FOUND).body("Token Expired");

第一个来自 apache servlet API 从接口 HttpServletResponse 找到的状态代码 here

SC_NOT_FOUND - Status code (404) indicating that the requested resource is not available.

第二个来自 spring 框架 http 状态码常量来自 here

NOT_FOUND 404 Not Found.

对于spring Framework (& spring boot),第二种被广泛使用。

没有区别,不同库的HTTP状态码是一样的