【发布时间】:2016-03-23 01:45:15
【问题描述】:
路线
Route::put('url/update',['as'=>'test.update', 'uses'=>'TestController@update']);
阿贾克斯
$.ajax({
url: 'url/update',
type: 'PUT',
dataType: 'json',
data: $inputs ,
success: function (data, textStatus, xhr) {
console.log(data);
},
error: function (xhr, textStatus, errorThrown) {
console.log('PUT error.', xhr, textStatus, errorThrown);
}
});
结果
PUT http://localhost:80/url/update 405 (Method Not Allowed)
【问题讨论】:
-
$device_mac中是否有空格或非法 URL 字符? -
不,里面不应该有空格。为什么我在某个地方有空间?
-
准确检查您在
$.ajax中获取的网址。 -
然后,我建议您对 URL 进行
console.log()和/或查看调试器的网络选项卡,并准确查看通过网络发送的请求 URL。 -
Request URL:http://localhost:8888/000D6766F2F6/device/080027E2FC7D继续切断我的最后 2 段。