Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

moses's avatar
Level 2

Why POST Request from POSTMAN returns empty?

My header in the postman like this :

enter image description here

My body like this :

enter image description here

In the routes laravel lumen, I check like this :

$router->group(['middleware' => 'auth'], function ($router) {
    ...
    $router->post('/sales-order', function (\Illuminate\Http\Request $request)
    {
        echo '<pre>';print_r($request->all());echo '</pre>';die();
    });
});

The result in the postman return empty array like this :

enter image description here

How can I solve the error?

0 likes
1 reply
qiutuleng's avatar
Level 2

@moses You should use the $request->getContent() function.

In my application:

$router->post('/', function (\Illuminate\Http\Request $request) use ($router) {
    echo <<<REGEXP
<pre>
{$request->getContent()}
</pre>
REGEXP;
});

I got this response on Postman:

<pre>
{"name": "FooBar"}
</pre>
1 like

Please or to participate in this conversation.