System.Net.Http.HttpRequestMessage
Request
private string GetUserHost(System.Net.Http.HttpRequestMessage request) { const string key = "MS_HttpContext"; if (!request.Properties.ContainsKey(key)) return string.Empty; var context = request.Properties[key] as System.Web.HttpContextWrapper; return context?.Request.UserHostAddress ?? string.Empty; }