Why POST Request from POSTMAN returns empty?
11,276
DUDE! I finally realize your parameters is wrong
"number": ""123""
you put 2 double quote it should "number": "123"
Author by
Success Man
Updated on June 08, 2022Comments
-
Success Man almost 2 years
My header in the postman like this :
My body like this :
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 :
How can I solve the error?
-
moses toh over 5 yearsIt works. But this : postimg.cc/image/dt5ihpoh3. Which I mark, it becomes text. No json
-
Beginner over 5 yearsthen modify your backend
-
moses toh over 5 yearsOkay. But I see here : laracasts.com/discuss/channels/general-discussion/…. It can use json and works. But why my postman is not works?
-
Beginner over 5 yearswhats the result anyway? screen shot it, seems the problem is in your backend
-
Beginner over 5 years
-
Beginner over 5 yearstry
$request->json()->all();
this then make it json again -
moses toh over 5 yearsIf use
Input:all();
, it's the same -
Beginner over 5 yearsdid you make it json again?
-
moses toh over 5 yearsIt does not work. If use
Content-Type application/json
the result empty -
Beginner over 5 years@SuccessMan at the beginning your code is just okay, its just you put an invalid json parameter just look at the postman there's a
x
mark which mean that format is incorrect and still it can display only by text -
moses toh over 5 yearsGreat. I really don't see that. But thanks a lot. It works. Have a nice day :)