Is there any way by which I can replace http://localhost:12345 while calling the WebAPI controller?
For Eg: For calling Controller we create URL like http://localhost:12345/api/Home?id=5 .. I do not want that.
I want my code to create http://localhost:12345 for me as string.
I had look around and I got this string baseURL = HttpContext.Current.Request.Url.Host;
but it is only giving me localhost
as an string.
In this statement Uri uri = new Uri("http://localhost:12345/api/Home?id=5");
we are passing URL to call controller. In my case, I want my this http://localhost:12345
part of URL should be created dynamically.
Can anyone suggest other way around?
Thank You