简体   繁体   English

加载资源失败:服务器响应状态为405()

[英]Failed to load resource: the server responded with a status of 405 ()

I'm having this error: 我遇到这个错误:

Failed to load resource: the server responded with a status of 405 () 加载资源失败:服务器响应状态为405()

How can I fix it? 我该如何解决? Here's my code: 这是我的代码:

views: 意见:

this.find('.deleteButton').unbind('click').on('click', function (e) {
    e.preventDefault();
    var $this = $(this);
    $.ajax({
        url: $this.data('url'),
        method: 'DELETE',
        success: function () {
            location.reload();
        }

routes: 路线:

Route::delete('/users/delete/{entity}', [
    'as' => 'users.delete',
    'middleware' => ['permission:delete-recruiters'],
    'uses' => 'UsersController@delete'
]);

controllers: 控制器:

public function delete(User $entity)
{
    $entity->delete();
}

Http status 405 is METHOD NOT ALLOWED, which might mean route you are trying to make request to is wrong. Http状态405为“方法不允许”,这可能意味着您试图向其发出请求的路由是错误的。 Check your $this.data('url'), most likely you are hitting different route. 检查您的$ this.data('url'),很可能是您选择了其他路线。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 加载资源失败:服务器响应状态为 405() 和 mysterius 输入 - Failed to load resource: the server responded with a status of 405 () and mysterius input 加载资源失败:服务器响应状态为405(不允许使用方法) - Failed to load resource: the server responded with a status of 405 (Method Not Allowed) 这是什么意思? “无法加载资源:服务器响应状态为405(不允许使用方法)” - What does this mean? “Failed to load resource: the server responded with a status of 405 (Method Not Allowed)” 加载资源失败:服务器响应状态为 404() - Failed to load resource: the server responded with a status of 404 () 加载资源失败:服务器响应状态为404 - Failed to load resource: the server responded with a status of 404 加载资源失败:服务器响应状态为 409 - Failed to load resource: the server responded with a status of 409 无法加载资源:服务器响应状态为404? 资源问题 - Failed to load resource: the server responded with a status of 404 ? Resource issue 无法加载资源:服务器响应状态为412(前提条件失败) - Failed to load resource: the server responded with a status of 412 (Precondition Failed) 程序无法加载无法加载资源:服务器以404(未找到)状态响应 - Program will not load Failed to load resource: the server responded with a status of 404 (Not Found) Node.js服务器:无法加载资源:服务器以状态404(未找到)响应 - Nodejs server: Failed to load resource: the server responded with a status of 404 (Not Found)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM