Hello I need get client IP that request some method in web api, I have tried to use this code from here but it always returns server local IP, how to get in correct way ?>
string userRequest = System.Web.HttpContext.Current.Request.UserHostAddress;
This works on me.
System.Web.HttpContext.Current.Request.UserHostName; this one return me the same return I get from the UserHostAddress.
System.Web.HttpContext.Current.Request.UserHostName;
UserHostAddress