为什么nodejs服务器在不良请求中返回404状态代码
我不明白,如果已注册错误的路由,服务器为什么返回404状态错误代码。 服务器应返回400个状态错误代码。 我想知道这可能与之有关。
I can't understand why the server returns the 404 status error code if the wrong route is registered.
The server should return 400 status error code.
I would like to know what this may be related to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
每当找不到资源时,就会使用状态代码404(找不到)。
由于您的路线未注册并且不存在,您将收到404
Status code 404 (not found) is used whenever a resource cannot be found.
Since your route is not registered and does not exist you will receive 404
这意味着Postman找不到/API/用户/注册。您应该附加API定义以及服务器定义
This means that Postman cannot find /api/users/register. You should attach the API definition as well as the server definition