public IRestResponse executeRequest(RestClient restClient, RestRequest request) { IRestResponse response = null; var stopWatch = new Stopwatch(); try { stopWatch.Start(); response = restClient.Execute(request); stopWatch.Stop(); } catch (Exception e) { Console.WriteLine("Exception : \n" + e.Message); } finally { // Logging raw request and response RestSharpHelper restSharpHelper = new RestSharpHelper(); restSharpHelper.LogRequest(restClient, request, response, stopWatch.ElapsedMilliseconds); } return(response); }