Search code examples
c#.nethttprequestrestsharprest

RestSharp get url after redirect


Is there a way to get the page url after redirect, with RestSharp?

For example, the code below will return page source of this thread, but how do I get the actual URL of the thread?

        var client = new RestClient("https://tinyurl.com/");
        var request = new RestRequest("yydfqddw", Method.GET);
        var queryResult = client.Execute(request).Content;
        

Thank you.


Solution

  • I haven't use RestSharp in a while, bit if I remember correctly the response should have a property named ResponseUri or similar.