RestSharp get full URL of a request

To get the full URL use RestClient.BuildUri()

Specifically, in this example use client.BuildUri(request):

RestClient client = new RestClient("http://www.some_domain.com");
RestRequest request = new RestRequest("some/resource", Method.GET);
request.AddParameter("some_param_name", "some_param_value", ParameterType.QueryString);

IRestResponse<ResponseData> response = client.Execute<ResponseData>(request);

var fullUrl = client.BuildUri(request);

Leave a Comment

tech