コード例 #1
0
        public async Task <string> GetEkontOfficesXml(EkontApiConfiguration ekontApiConfiguration)
        {
            string username = ekontApiConfiguration.Username;
            string password = ekontApiConfiguration.Password;
            string url      = ekontApiConfiguration.Url;

            var content = new StringContent(
                $"<?xml version=\"1.0\"?>" +
                $"<request>" +
                $"<client>" +
                $"<username>{username}</username>" +
                $"<password>{password}</password>" +
                $"</client>" +
                $"<request_type>" +
                $"offices" +
                $"</request_type>" +
                $"</request>", Encoding.UTF8, "text/xml");

            var response = await client.PostAsync($"{url}", content);

            return(await response.Content.ReadAsStringAsync());
        }
コード例 #2
0
 public ExternalApiController(IHttpService httpService, IOptions <EkontApiConfiguration> ekontApiConfiguration, IUserService users, ISettingsService settings) : base(users, settings)
 {
     this.httpService           = httpService;
     this.ekontApiConfiguration = ekontApiConfiguration.Value;
 }