本文介绍了.NET 4.5 HttpClient的请求的ServicePoint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直使用至今:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(targetUri); do the request ................. request.ServicePoint.现在我想用新的HttpClient从.NET 4.5,我不知道该怎么访问的ServicePoint属性。
Now I would like to use the new HttpClient from 4.5 and I don't know how to access the ServicePoint properties.
任何想法我怎么能使用HttpClient的?
Any ideas how can I access the ServicePoint by using HttpClient?
推荐答案的的HttpWebRequest 内部使用的HttpClient ,但隐藏了大部分的功能。我相信,你将不得不使用 ServicePointManager 做你想要什么,而不是。喜欢的东西;
The HttpWebRequest is used internally in HttpClient, but hides most of the functionality. I believe you will have to use the ServicePointManager to do what you want instead. Something like;
ServicePointManager.FindServicePoint(targetUri)更多推荐
.NET 4.5 HttpClient的请求的ServicePoint
发布评论