0

When I use Postman to send or get data to/from my local Laravel applications it always returns the error...

Could not get any response. For example, a GET request to http://demo_app.localhost/api/data.

I use Laravel Valet on my Mac. It looks like Postman can't find the local domain.

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
MelWet
  • 273
  • 1
  • 3
  • 6

3 Answers3

8

I had the same issue when trying to use valet with Postman and what fixed it for me was turning off the SSL verification in Settings > General. I believe valet is using some internal SSL certificate by default that cannot be verified properly by Postman.

SSL setting

mrjman
  • 124
  • 1
  • 4
0

Use TLD .test, if your Valet version is up-to-date and not specifically configured to use .localhost.

Should be like http://demo_app.test/api/data

See official docs for background:

Valet documentation at chapter "Using Another Domain".

frankfurt-laravel
  • 3,731
  • 2
  • 20
  • 29
0

I had the same issue and used all the suggestion above, none of them works. For my case, I used the following command to fix the problem:

php artisan optimize

This clears the cache and config files and reloads the new api Routes added to the Laravel framework.

teemran
  • 133
  • 1
  • 11