cURL error 28: Operation timed out after 3002 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:8000/index2
replacing localhost with 127.0.0.1 will just cause infinite loop?
Have you ever faced such error?
How are we going to call our localhost APIs using Http facade?
this unfortunately is not possible (i mean, at least in this simple out-of-the-box form), because the php built-in server is single-threaded. but there is a chance, you have two options:
either start two servers and connect from one to another (different port),
or try this suggestion from internet, start the server with multiple workers:
@Snapey Yes I tried xampp and it worked on localhost. I am trying to simulate microservices in form of packages on the same server. Up to this point it has been successful. Thank you
@danimohamadnejad As @s4muel has mentioned, this isn’t possible when using artisan serve because it uses the built-in PHP server, which is single-threaded. This means that when you open your page, it uses the thread, and when you make a HTTP call, it’s trying to make a second request at the same time to your application, but the thread is already occupied trying to serve the initial request.
Why are you trying to make HTTP requests back to the same application in the first time?