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

xhoik's avatar
Level 1

API Request keeps loading - Laravel 5.7.1

Route::post('test', function(){ echo "Test"; });

I have this simple api and the first time i make a request with postman it sends a response then it keeps loading forever. It stall the whole application. (Even if i do a GET request it's the same)

0 likes
6 replies
shez1983's avatar

how about if you do it in a browser? and refresh..

xhoik's avatar
Level 1

It's the same, the whole application stall

tykus's avatar

What else is happening in the context of that request; is there some middleware running?

If you try to return a full Response rather than simply echo does it change the result?

Route::post('/', function () {
    return response('Test');
});
Mohamadreza's avatar

Have you added the csrf token field in your postman ? ..... In post methods it's necessary to add the csrf field in your posting data

If you haven't you can add it or disable its middleware from your service providers

xhoik's avatar
Level 1

It has something to do with the web server i guess because it happens the same if i try to open the welcome page of laravel

shez1983's avatar

i think i create a fresh installation of laravel and then test it without doing anything go to the home page, hit fresh on your browser couple of times... and see if you get the same thing..

without knowing what you have done with your laravel installation we cant help you - github repo would be better..

Please or to participate in this conversation.