salesforce网址无法使用c#.net代码

时间:2019-12-06 17:30:21

标签: c# .net ssl salesforce

要呼叫salesforce api,我正在使用如下所示的restclient-

  var client = new RestClient("https://test.salesforce.com/services/oauth2/token");
                var request = new RestRequest(Method.POST);
                request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
                request.Parameters.Clear();
                request.AddParameter("grant_type", "password");
                request.AddParameter("username", userName);
                request.AddParameter("password", password);
                request.AddParameter("client_id", clientID);
                request.AddParameter("client_secret", clientSecret);
                response = client.Execute(request);

但出现错误-

The SSL connection could not be established, see inner exception. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.   

有人知道为此工作吗?

0 个答案:

没有答案