There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
UpForGrabs: User IP Address in Web API RC
I've seen on various MS forums and Stack Overflow, the way to retrieve the user's IP address in Web API, requires falling back to the untestable (without mocking) static context object model by doing the following:
var ip = ((HttpContextWrapper) request.Properties["MS_HttpContext"]).Request.UserHostAddress;
var ip = ((HttpContextWrapper) request.Properties["MS_HttpContext"]).ServerVariables["REMOTE_ADDR"];
It seems counter to the very idea of Web API to have to return to using HttpContext.
Is this a temporary measure in the RC, or is there a better way to get this information?