Laravel在post请求中将请求显示为get


Laravel showing request as get in post request?

当我发送POST请求时,Laravel在控制器中返回Get请求。

我的网址,

http://localhost/walls/app/api/public/api/auth/signup

我的路线,

Route::group(['prefix' => 'auth'], function () {
 Route::post('signup', 'AuthenticateController@signup');
});

AuthenticateController,

  public function signup(SignupRequest $request) {
        return $request;
   }

响应,

GET  
{
    "user_type": "1",
    "name": "shihab",
    "email": "shihab@corediary.com",
    "password": "123456",
    "access_token": "",
    "refresh_token": "",
    "expiry_date": ""
}

工作正常,但有时会显示这种错误。原因是什么?我该如何解决?

我曾经遇到过这样的问题。问题出在路线上它应该是这样的:

Route::post('/signup', 'AuthenticateController@signup');

,你必须确保请求是作为POST发送的(观察网络)。

抱歉我不能添加注释