In My application the scenario like i want to read the client requested URL from ASP.NET WEB API.

Example:

https://xxx.test.com/test.html page is calling https://api.test.com/api/home/get/1 WEB method.

The requested url https://xxx.test.com/test.html need to read from the web method.

The below code is returning IP Address. It is not returning domain url.

// GET api/home/get/5
public string Get(int id)
{
return HttpContext.Current.Request.UserHostAddress;
}

Please suggest me.

Thanks in Advance.

Related posts

Recent Viewed