.NET 4.5 HttpClient的请求的ServicePoint

编程入门 行业动态 更新时间:2024-10-26 16:30:51
本文介绍了.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

本文发布于:2023-11-13 01:13:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583000.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:NET   ServicePoint   HttpClient

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!