示例#1
0
        public async Task <T> Get(KnowledgeBaseQuery query)
        {
            var request = new HttpRequestMessage(HttpMethod.Get, query.Url);

            request.Headers.Add("X-Auth-Token", query.Token);

            // return ReadFile<T>.GetFromXml(@"~/../Data/KbStations.xml");

            var response = await httpClient.SendAsync(request);

            return((await response.Content.ReadAsStringAsync())
                   .DeserialiseXml <T>());
        }
        public async Task <NetworkOverviewModel> Get(KnowledgeBaseQuery query)
        {
            var request = new HttpRequestMessage(HttpMethod.Get, query.Url);

            request.Headers.Add("Accept", "application/xhtml+xml");
            request.Headers.Add("X-Auth-Token", query.Token);

            var response = await httpClient.SendAsync(request);

            return((await response.Content.ReadAsStringAsync())
                   .DeserialiseXml <NetworkOverviewModel>());
            //return GetFromXml();
        }