发布话题报错 “该路由不支持 POST 方法,支持的方法是:GET,HEAD。”?

发布话题报错“该路由不支持POST方法,支持的方法是:GET,HEAD。”?如图:

发布话题报错“该路由不支持POST方法,支持的方法是:GET,HEAD。”?
教程中的路由似乎确实没有 post?如图:

发布话题报错“该路由不支持POST方法,支持的方法是:GET,HEAD。”?

我好像也是照着做的:

发布话题报错“该路由不支持POST方法,支持的方法是:GET,HEAD。”?

发布话题报错“该路由不支持POST方法,支持的方法是:GET,HEAD。”?
小白一个,恳请帮助为谢!

《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 5

resource路由包含有post的,只是你的postman那里,post应该改为get,因为请求一个列表的动作应该是get。你可以执行 php artisan route:list 查看所有的路由。

3年前 评论

我改用get报错:

"message": "Method App\\Http\\Controllers\\Api\\TopicsController::index does not exist.",
"exception": "BadMethodCallException",
"file": "/home/vagrant/Code/larabbs/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
"line": 68,
"trace": [
    {
        "function": "__call",
        "class": "Illuminate\\Routing\\Controller",
        "type": "->"
    },
3年前 评论

使用php artisan route:list报错: Illuminate\Contracts\Container\BindingResolutionException : Target class [App\Http\Controllers\ImagesController] does not exist.

at /home/vagrant/Code/larabbs/vendor/laravel/framework/src/Illuminate/Container/Container.php:805 801| 802| try { 803| $reflector = new ReflectionClass($concrete); 804| } catch (ReflectionException $e) {

805| throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e); 806| } 807| 808| // If the type is not instantiable, the developer is attempting to resolve 809| // an abstract type such as an Interface or Abstract Class and there is

Exception trace:

1 Illuminate\Foundation\Console\RouteListCommand::Illuminate\Foundation\Console{closure}(Object(Illuminate\Routing\Route)) [internal]:0

2 ReflectionException::("Class App\Http\Controllers\ImagesController does not exist") /home/vagrant/Code/larabbs/vendor/laravel/framework/src/Illuminate/Container/Container.php:803

Please use the argument -v to see more details. vagrant@homestead:~/Code/larabbs$ --------------- 真不知道是哪儿出错了!

3年前 评论

@gyhjy 你的代码不完整,缺少了好多个类

3年前 评论

问题已解决,是我自己粗心码错了代码。谢谢各位的帮助!谢谢!

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!