.NET 4.5 HttpClient request ServicePoint

折月煮酒 提交于 2019-12-12 10:57:09

问题


I have always used so far:

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(targetUri);

do the request
.................
request.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.

Any ideas how can I access the ServicePoint by using HttpClient?


回答1:


I believe you will have to use the ServicePointManager to do what you want. Something like;

ServicePointManager.FindServicePoint(targetUri)


来源:https://stackoverflow.com/questions/19174974/net-4-5-httpclient-request-servicepoint

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!