简体   繁体   中英

trouble to send request in postman in laravel api.php post method

I write a simple post method Route in api.php and postman errored

I also add put Accept = Application/json in headers and return a value to a

but postman do not work

this is postman error

postman image issue

and this is my api.php

Route::post('/p', function (Request $request) {
    $a = $request->a;
    return response(a,200);
});

Thanks

Route::post('/p', function (Request $request) {
    $a = $request->a;
    return response($a, 200);
});

You missed the '$' in response($a, 200)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM