Php laravel 5.8-邮递员测试api请求变为空

Php laravel 5.8-邮递员测试api请求变为空,php,laravel,Php,Laravel,我遵循并使用postman测试api。在localhost中,一切正常。但是当我上传到生产服务器时,不知何故,api请求数据被过滤掉了 我按照说明安装passport,并在各种文件中安装所有这些设置。然后我在生产服务器上迁移了php artisan,之后,php artisan passport:install,然后消息说成功: Encryption keys generated successfully. Personal access client created successfully.

我遵循并使用
postman
测试
api
。在
localhost
中,一切正常。但是当我上传到生产服务器时,不知何故,
api
请求数据被过滤掉了

我按照说明安装
passport
,并在各种文件中安装所有这些设置。然后我在生产服务器上迁移了php artisan,之后,php artisan passport:install,然后消息说成功:

Encryption keys generated successfully.
Personal access client created successfully.
Client ID: 1
Client secret: <some long strings>
Password grant client created successfully.
Client ID: 2
Client secret: <some long strings>
路线:

api.php:
Route::post('/resident/test','ResidentsController@testing');
所以我用
postman
呼叫:

POST : http://examplehost/api/resident/test/
关于数据:

{"name":"user001"}
和标题:

Content-Type: application/json //<-- which enough for localhost

我不知道我漏掉了哪一部分。如何解决这个问题?

在Postman中,单击body,选择raw并从下拉列表中选择JSON(应用程序/JSON)

在正文中,插入JSON

 {"name":"user001"} 
在你的测试方法中

if ( $request->isJson() ) {
    $json = json_decode(trim($request->getContent()),true);
    return response()->json($json);
}
[
Content-Type: application/json,
Authorization: {{'bearer'.$accessToken}} ///<-- which the direction from tutorial
]
[]
 {"name":"user001"} 
if ( $request->isJson() ) {
    $json = json_decode(trim($request->getContent()),true);
    return response()->json($json);
}