Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpClient HttpResponseMessage Address / URI

I am developing a C# WinRT application that makes POST and GET requests to a webserver.

Does anyone know if there is a way to get the Response URI / Address when using a HttpClient object?.

If I use the HttpWebRequest / HttpWebResponse classes, then I can get this information (via the ResponseUri property in HttpWebResponse), but I don't see how to obtain it using the HttpClient / HttpResponseMessage classes.

Thanks

like image 793
Michael Sabin Avatar asked Jul 26 '12 20:07

Michael Sabin


1 Answers

This is two years old, but I just came across this question with the exact same desire, and it was answered in a comment by @PeterRitchie, so I am copying that for future visitors.

I think you can get the redirected UI from HttpResponseMessage.RequestMessage.RequestUri

like image 115
Matthew Haugen Avatar answered Oct 02 '22 13:10

Matthew Haugen