简体   繁体   English

HttpClient HttpResponseMessage地址/ URI

[英]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.

相关问题 HttpClient HttpResponseMessage LastModified文件的日期 - HttpClient HttpResponseMessage LastModified date of file 使用HttpClient和HttpResponseMessage的带有两个字符串的PostAsync - PostAsync with two strings using HttpClient and HttpResponseMessage Output 从 HttpClient HttpResponseMessage 到控制台的所有标头 - Output all headers from HttpClient HttpResponseMessage to console 异步调用HttpClient以通过Ajax获取HttpResponseMessage - Calling HttpClient asynchronously to get the HttpResponseMessage via ajax 使用HttpClient发布并读取HttpResponseMessage状态 - Post using HttpClient & Read HttpResponseMessage status 使用 ipv6 地址连接到使用 HttpClient 的服务器(使用 ipv6 地址定义 URI)修复 - Invalid URI: Invalid port specified) - Using ipv6 address to connect to a server using HttpClient (using ipv6 address to define URI) Fixing - Invalid URI: Invalid port specified) 使用HttpClient保留转义的Uri - Preserve an escaped Uri with HttpClient 如何使用 HttpClient 从缓存中确定 HttpResponseMessage 是否已完成 - How to determine if an HttpResponseMessage was fulfilled from cache using HttpClient 使用HttpClient时HttpResponseMessage缺少标头,但提琴手找到了 - HttpResponseMessage missing headers while using HttpClient but fiddler finds it 从HttpClient到用户定义的对象C#的HttpResponseMessage - HttpResponseMessage from HttpClient to User Defined Object C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM