I have a method GetIP() which takes the System.Web.HttpRequestBase as a parameter. Could anyone help on how do I get the HttpRequestBase object.
I assume it's really basic but not able to figure out.
Thank you.
I have a method GetIP() which takes the System.Web.HttpRequestBase as a parameter. Could anyone help on how do I get the HttpRequestBase object.
I assume it's really basic but not able to figure out.
Thank you.
I dont know what context you are in but you can get it from HttpContext.Current.Request
. Note that HttpContext.Current
does not work if you are hosting the web api outside of iis.
var request = new HttpRequestWrapper(HttpContext.Current.Request);