There are alternatives to making HTTP calls. Here, we make a simple comparison among some approaches.
Install pyenv (if you want it) and PDM.
pdm install
pdm run start # On a terminal 1
pdm run test-it # On a terminal 2
https://www.digitalocean.com/community/tutorials/python-simplehttpserver-http-server