I have a Laravel app running in Docker containers using Laravel Sail. I want to call an endpoint of the same laravel app from the same app.
I am using Guzzle HTTP client for that, but since app is running inside the container ( using Sail ) it is not able to connect to it and make request.
I tried using host.docker.internal
as host for my endpoint but this gives me 502 bad gateway.
which host should I use to make requests inside the same container?
Laravel sail uses artisan serve. Artisan serve not allow nested requests.
More info here: https://laracasts.com/discuss/channels/general-discussion/laravel-app-not-responsive-to-other-requests-while-making-guzzle-request
https://laracasts.com/discuss/channels/laravel/api-call-not-returning-a-response
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.