RestSharp for .Net Framework如何通过直接连接(没有代理)进行RestRequest的请求

问题描述 投票:0回答:1

我正在使用RestSharp 106.6.10。正如我以为的那样,需要发出一个跳过默认代理的请求:

var client = new RestClient("https://<my ip>");
client.Proxy = null; //=> it is null by default, in reality
...
var request = new RestRequest("streams/..."

但是实际上使用了默认代理,并且代理拒绝了身份验证问题的请求。

任何想法?

谢谢,洛伦佐

proxy restsharp
1个回答
0
投票

已解决

1)client.Proxy = null; =>无效(如前所述)

2)client.Proxy = GlobalProxySelection.GetEmptyWebProxy(); =>确定,但已弃用

3)client.Proxy = new WebProxy(); =>正常

希望对他人有帮助,谢谢大家。

洛伦佐

© www.soinside.com 2019 - 2024. All rights reserved.