protected async Task SendRestRequest(DocusignResponse restResponse, HttpMethod method, string path, object body, Dictionary <string, string> query = null) { HttpResponseMessage response = await HttpAgent.SendRestRequest(authAgent, method, path, body, query, true); string responseContent = await response.Content.ReadAsStringAsync(); restResponse.Initialize(response, responseContent); if (restResponse.NeedsRefresh) { authAgent.RefreshAuthToken().Wait(); response = await HttpAgent.SendRestRequest(authAgent, method, path, body); responseContent = await response.Content.ReadAsStringAsync(); restResponse.Initialize(response, responseContent); } }