0

Our organization is removing our proxy web servers and integrating Zscalar. We were informed that all we had to do is remove the proxy property/settings. So I have removed the proxy setting from my code and it seems to work fine locally but it will not work on our server. Is there something I am missing here? We are also using RestSharp 105.2.30

Dim js As New System.Web.Script.Serialization.JavaScriptSerializer
Dim utils As New Utilities.Common
Dim rc As RestSharp.RestClient
rc = New RestSharp.RestClient("https://www.someendpointurl")
Dim rr As New RestSharp.RestRequest(RestSharp.Method.POST)
rr.AddHeader("Authorization", "Basic " & RetrieveTokens("MSIC"))
Dim rs As New RestSharp.RestResponse()
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
rs = rc.Execute(rr)
dctValues = js.Deserialize(Of Dictionary(Of String, String))(rs.Content)


steveyT
  • 1
  • 2
  • For anyone to answer, you will most likely need to expand on "will not work". I would also suggest you might tag in IIS (or what ever you hosting server is). Working properly locally suggest to me it's a server config/environment issue of some nature – Hursey May 04 '22 at 00:39
  • `it will not work on our server.` You need to share some error message or any other things to let us know what you mean it not work. – Bruce Zhang May 05 '22 at 03:13
  • Problem has been resolved. So it turns out that there was a rule blocking access to the End Point URL. The code above works fine. Thanks everyone for your help and input. Also the only error I was getting from RestSharp was Code status=0 Object not being set. – steveyT May 09 '22 at 16:35

1 Answers1

0

After hours of trouble-shooting, turns out in this case it was not a code issue. It was a internet and firewall connection issue on the server. So the code above is valid and works grea

steveyT
  • 1
  • 2