.NET 4.5 HttpClient request ServicePoint

2019-06-27 10:14发布

问题:

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)


标签: c# .net-4.5