0

I was using an older version of Restsharp (about a year ago!) and then updated to the newest version. (Current 108.0.2 installed). The call I'm running is to a local computer, to a third party API. If I run the call in postman, I get a 12ms response. If I run this in my app using restsharp, the response is around 4000ms (tested 20 times)

My code is as below:

string zServerName = "http://" + dispenseDetails.dipenseServerCompName + ":8800/Api/";

                var options = new RestClientOptions(zServerName);
                
                var client = new RestClient(options);
                
                var request = new RestRequest(endpoint);
                request.Method = apiMethod;   
               
                    
                request.AddHeader("Authorization", "Bearer " + dispenseDetails.curZToken);
                }
               
                var response = client.Execute(request);
                Debug.WriteLine(response);

I'm getting data to display in a table. There are no proxys I'm aware of, it is just a basic call to the server.

I would understand it could be network related if BOTH my app and postman were slow but I can't figure why only my app is! I'm relatively new at coding, so any help would be appreciated.

GAngel
  • 1
  • 2

0 Answers0