[英]HttpClient HttpResponseMessage Address / URI
I am developing a C# WinRT application that makes POST and GET requests to a webserver. 我正在开发一个C#WinRT应用程序,它向Web服务器发出POST和GET请求。
Does anyone know if there is a way to get the Response URI / Address when using a HttpClient object?. 有没有人知道在使用HttpClient对象时是否有办法获取响应URI /地址?
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. 如果我使用HttpWebRequest / HttpWebResponse类,那么我可以获取此信息(通过HttpWebResponse中的ResponseUri属性),但我没有看到如何使用HttpClient / HttpResponseMessage类获取它。
Thanks 谢谢
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. 这已经有两年了,但是我刚刚用完全相同的愿望遇到了这个问题,并且在@PeterRitchie的评论中得到了回答 ,所以我正在为未来的访问者复制这个问题。
I think you can get the redirected UI from HttpResponseMessage.RequestMessage.RequestUri 我想你可以从HttpResponseMessage.RequestMessage.RequestUri获得重定向的UI
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.