✅ How to talk to Web API hosted on RPI?
Hello, I have created a Web API project with C# and I have published that project to my Pi. When I run the 'launch' command on my Pi I receive:
In Postman, I want to connect to it by using the following
http://{my-PI-IP}:5000/{my-Endpoint}
Yet I keep receiving Error: connect ECONNREFUSED {my-PI-IP}:5000.
The image describes my publish specifications. And In my program.cs I only added these lines of code just to be sure:
Program.cs
This is what my launchSettings.json
looks like;
8 Replies
You are binding to localhost, not all available interfaces
Meaning only local connections are accepted
he is using
ListenAnyIP
thoYes, but the launch message is quite clear
So we must figure out why
i would try using
--urls
in the command line as a first testUnknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Thanks for the replies. I gave it a go again without any changes and somehow it did not work at first, due to permission issues in Linux. But after fixing that I ran the stuff again and it works...
http://{my-PI-IP}:5000/{my-endpoint}
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
If you have no further questions, please use /close to mark the forum thread as answered