I created a simple Asp.net Web Api. When I run the code Chrome is opening and getting xml data from sql server database. Here is the link: http://localhost:50599/api/Menu/. And this my output: https://i.sstatic.net/hKeZd.png
But when I put my local address instead of "localhost" it gives me 400 error. My IIs is running. when I enter 127.0.0.1 or 192.168.1.104 or localhost IIS page is opening.
I did everything for opening 127.0.0.1:50599/api/menu or 192.168.1.104:50599/api/menu but error 400 apears. I changed
<binding protocol="http" bindingInformation="*:8080:localhost" />
to
<binding protocol="http" bindingInformation="*:8080:*" />
and it didnt work for me.
How can I solve this problem. If I can make this work I will access this Api from an android device.
I ran into the same problem you did and I know I'll be repeating some of the stuff you did but try to bear with me.
Edit the applicationhost.config in the root solution folder. It's in a hidden folder called .vs.
In your site, add:
<binding protocol="http" bindingInformation="*:port:*" />
<binding protocol="http" bindingInformation="*:port:youripaddress" />
If you see 8080 which is the default port, you are in the wrong section.
Open Visual Studio in administrator mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With