为什么nodejs服务器在不良请求中返回404状态代码

发布于 2025-01-25 21:31:49 字数 182 浏览 2 评论 0原文

我不明白,如果已注册错误的路由,服务器为什么返回404状态错误代码。 服务器应返回400个状态错误代码。 我想知道这可能与之有关。

Postman

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.

postman

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

难忘№最初的完美 2025-02-01 21:31:49

每当找不到资源时,就会使用状态代码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

扛刀软妹 2025-02-01 21:31:49

这意味着Postman找不到/API/用户/注册。您应该附加API定义以及服务器定义

This means that Postman cannot find /api/users/register. You should attach the API definition as well as the server definition

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文