How to get the URI from which the REST API (ServiceStack) is used

I have a problem with the REST API that I created using a service program. The end user will use this API from his application hosted on their server. I would like to get the absolute uri and IP address from which this REST API was used.

When I test it locally, as shown below, it gives me the URL of the REST API itself instead of the application from which it is consuming.

 string str = RequestContext.AbsoluteUri.ToString();

Please, how can I get information about the source where my REST API is consuming from.

Thanks at Advance.

+3
source share
1 answer

, , URL- ? ? ASP.NET , -, :

var aspnetReq = (HttpRequest)RequestContext.Get<IHttpRequest>().OriginalRequest;

.

+1

All Articles