I am using Docker for Windows to host the Laravel instance
I have Laravel running on Docker (running on http://localhost:8080). I have an API service on a http://api.mywebsite.test which is on my computer - not in a docker.
I'm trying to CURL the REST API from the docker website. It doesn't respond and I have no clue why.
When i curl from bash, it works correctly. Example :
curl --location --request POST 'http://oauth.mysite.test/server.php?grant_type=client_credentials' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials'
From my browser it works as well.
But from my php script, file_get_contents for example returns an error :
ErrorException: file_get_contents(http://oauth.mysite.test/server.php): Failed to open stream: HTTP request failed!
Using Guzzle just loops forever and just crashes my Docker which I need to then restart.