예제 #1
0
        private async Task <TResult> GetAsync <TResult>(string path)
        {
            string url = baseUrl + Version + path;

            var responseText = await SendAsync(new HttpRequestMessage(HttpMethod.Get, url));

            return(Route53Serializer <TResult> .DeserializeXml(responseText));
        }
예제 #2
0
        private async Task <TResult> PostXmlAsync <T, TResult>(string path, T instance)
            where T : notnull
            where TResult : notnull
        {
            string url = baseUrl + Version + path;

            var content = new ByteArrayContent(Route53Serializer <T> .SerializeToUtf8Bytes(instance));

            content.Headers.ContentType = new MediaTypeHeaderValue("application/xml");

            string responseText = await SendAsync(new HttpRequestMessage(HttpMethod.Post, url) {
                Content = content
            });

            return(Route53Serializer <TResult> .DeserializeXml(responseText));
        }