【问题标题】:Run in Postman from application从应用程序在 Postman 中运行
【发布时间】:2019-03-08 05:14:38
【问题描述】:

在 Postman 中测试我的服务器时,状态为 404 NOT_FOUND:

{"error":{"statusCode":404,"name":"Error","message":"共享类 \"App\" 没有处理 GET 的方法 /56fd2bf04fbf42f357f6b112/versions","stack":"错误:共享类 \"App\" 没有处理 GET 的方法 /56fd2bf04fbf42f357f6b112/versions\n at restRemoteMethodNotFound (D:\PKL\cyclone-backend\node_modules\strong-remoting\lib\rest-adapter.js:388:17)\n 在 Layer.handle [as handle_request] (D:\PKL\cyclone-backend\node_modules\express\lib\router\layer.js:95:5)\n 在 trim_prefix (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:317:13)\n 在 D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:284:7\n 在 Function.process_params (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:335:12)\n 接下来 (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:275:10)\n 在 Function.handle (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:174:3)\n 在路由器 (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:47:12)\n 在 Layer.handle [as handle_request] (D:\PKL\cyclone-backend\node_modules\express\lib\router\layer.js:95:5)\n 在 trim_prefix (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:317:13)\n 在 D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:284:7\n 在 Function.process_params (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:335:12)\n 接下来 (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:275:10)\n 在 jsonParser (D:\PKL\cyclone-backend\node_modules\body-parser\lib\types\json.js:103:7)\n 在 Layer.handle [as handle_request] (D:\PKL\cyclone-backend\node_modules\express\lib\router\layer.js:95:5)\n 在 trim_prefix (D:\PKL\cyclone-backend\node_modules\express\lib\router\index.js:317:13)"}}

Screenshot Here

【问题讨论】:

  • 您的应用程序路由似乎不支持 GET 请求,请尝试将请求方法更改为 POST 并“发布”所需的参数,或者如果使用 GET 方法,请将 :id 参数替换为某个值。跨度>
  • 好的,谢谢您的回答。我得到了这个:)

标签: node.js http postman


【解决方案1】:

基本上404 请求通常是由于输入了错误的 URL 或错误的 HTTP 方法。您可以仔细检查它们,您应该会找到解决方案。

【讨论】:

    猜你喜欢
    • 2020-03-05
    • 2022-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-26
    • 2023-04-03
    • 1970-01-01
    • 2018-02-01
    相关资源
    最近更新 更多