public DownloadEnvelopesResponse DownloadCommandEnvelopes(DownloadEnvelopeRequest request)
        {
            var settings = loginSettingsRepository.GetSettings();

            using (var client = new HttpClient())
            {
                client.Timeout = Timeouts.DefaultHttpTimeout();
                client.BaseAddress = new Uri(settings.ServerUrl);

                var response = client.PostAsync(NextEnvelopeEndpoint, CreateContent(request)).Result;

                var text = response.Content.ReadAsStringAsync().Result;

                return JsonConvert.DeserializeObject<DownloadEnvelopesResponse>(text);
            }              
        }
 private HttpContent CreateContent(DownloadEnvelopeRequest request)
 {
     return new StringContent(JsonConvert.SerializeObject(request), Encoding.UTF8, NextEnvelopeEndpointContentType);
 }