[HTTP-Client] failed to connect to localhost

@soumiail, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project :wink: See About the Installation & Troubleshooting category.

127.0.0.1 is the IP of the localhost. So your code (as it currently stands) needs to run on the same system as where the web server is running.

If the web server is on e.g. your PC and you want to connect to it, you need to use the IP address of the PC.
If the web server is on the NodeMCU and you want to connect from a browser on e.g. the PC or phone, you will need to use the IP address of the NodeMCU in the browser.