本文介绍了.NET 4.5 HttpClient 请求 ServicePoint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
到目前为止我一直在使用:
I have always used so far:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(targetUri);
do the request
.................
request.ServicePoint.
现在我想使用 .net 4.5 中的新 HttpClient,但我不知道如何访问 ServicePoint 属性.
Now I would like to use the new HttpClient from .net 4.5 and I don't know how to access the ServicePoint properties.
任何想法如何使用 HttpClient 访问 ServicePoint?
Any ideas how can I access the ServicePoint by using HttpClient?
推荐答案
我相信您将不得不使用 ServicePointManager 做你想做的事.类似的东西;
I believe you will have to use the ServicePointManager to do what you want. Something like;
ServicePointManager.FindServicePoint(targetUri)
这篇关于.NET 4.5 HttpClient 请求 ServicePoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!