【发布时间】:2021-06-10 18:56:17
【问题描述】:
我在实时服务器上收到了这个错误(在部署项目之后)..这个错误没有出现在本地主机上 这是请求代码:
$('#SeekerCommunication_table').Tabledit({
url:"/update-Communications/action/",
dataType:'json',
columns:{
identifier : [0, 'ssn'],
editable:[
[1,'id'],
},
restoreButton:false,
deleteButton:false,
onSuccess:function(data, textStatus, jqXHR)
{
if(data.action === 'edit'){
$('#SeekerCommListModal').modal('hide');
}
}
});
这是路线
Route::post('/update-Communications/action/',[CommunicationController::class,'action'])->name('UpdateCommunications');
错误是 消息:“此路由不支持 GET 方法。支持的方法:POST。”,...} 异常:“Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException” 文件:“H:\root\home\irbidchambernew-001\www\epusubdomin\vendor\laravel\framework\src\Illuminate\Routing\AbstractRouteCollection.php” 线路:117 消息:“此路由不支持 GET 方法。支持的方法:POST。” 有什么帮助吗?
【问题讨论】:
-
将方法添加到您的请求中,因为您定义了发布路线,但您正在发出获取请求
-
似乎有一个 PR 待定,它将添加在编辑 + 删除时设置 HTTP 方法的功能,但尚未合并 - github.com/markcell/jquery-tabledit/pull/64/files