我对laravel和laravel-5很新。当我执行POST请求时,我在Firebug控制台中获得200响应和登录请求。Laravel:Ajax post请求路由
routes.php文件
Route::group
(
[
'prefix' => '/',
'namespace' => 'Landing'
],
function()
{
Route::controller('', 'WelcomeController');
}
);
WelcomeController.php
public function postUserContact()
{
print_r($_POST);
}
Ajax请求:
$.ajax({
url : window.location.protocol + "//" + window.location.host + '/user-contact',
type : 'POST',
async : true,
cache : false,
processData : true,
data : {name:name,email:email,message:message},
success : function (returnedData)
{console.log(returnedData)}
});
请心病RECT我如果有什么错
+1
和你的问题? (**注意:** 200回应意味着成功) –
+0
@SHAZ。我得到200响应登录。但在我的行动是不是登录功能。 –
+0
也许你在你的WelcomeController构造函数中有一个'auth'中间件?! –