HttpClient HttpResponseMessage Address / URI

2019-06-20 15:46发布

问题:

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

回答1:

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