0

I am currently trying to create a valid link to a function of my API using this LOC:

Uri locationHeader = new Uri(Url.Link("GetUserById", new { id = user.Id }));

This returns the following:

http://localhost:53800/..../user/821105b1

However, as the link should be accessible from the network, I would need something like the following:

http://192.168.0.12:53800/..../user/821105b1

How can I get this result instead of the one with the localhost??

Thanks in advance!

1 Answers1

0

Calling local libraries will only give you the local IP. You can call an external API like whatismyip or checkip to get the external IP. See here...https://stackoverflow.com/a/7838551

Community
  • 1
  • 1
Tija
  • 1,691
  • 4
  • 20
  • 33