【问题标题】:MethodNotAllowedHttpException Laravel 5.2MethodNotAllowedHttpException Laravel 5.2
【发布时间】:2016-08-31 04:56:38
【问题描述】:

嘿,我遇到了这个奇怪的错误

MethodNotAllowedHttpException

我在互联网上无论如何都找不到解决方案,请问有什么建议吗?

这里是:

Route::post('api/avatarDetails/{avId}', 'API\APIController@doAvatarDetails');
Route::get('api/avatarDetails', function() {
  return Redirect::to('/')->with('failure', 'You lack the ability to do that young one.');
});

你去@Alexy

Route::get('/', function() {
  return view('welcome');
});

【问题讨论】:

  • 收到此错误消息时,您尝试使用哪个 URL?
  • api/avatarDetails 尝试向其发布 avId 并从我的 jsonrpc 服务器返回 json 数据。

标签: php laravel


【解决方案1】:

我没有看到这条路线,但你仍在尝试重定向到它:

Route::get('/', function () {
    //
});

如果有,请运行php artisan route:clear 命令,该命令将清除所有旧路由缓存。

【讨论】:

  • 那么你有'/'的路线吗?如果是,请将其添加到您的问题中。
  • 尝试使用php artisan route:clear 命令清除路由缓存。如果这没有帮助,请运行 php artisan route:list 并在您的问题中发布列表。
猜你喜欢
  • 2018-01-13
  • 1970-01-01
  • 2016-06-23
  • 2016-06-04
  • 2016-06-15
  • 2016-06-20
  • 2016-12-26
  • 2016-09-18
  • 2016-07-30
相关资源
最近更新 更多