Exemplo n.º 1
0
        public async Task <T> SendRequestAsObjectAsync <T>(API.IRequestable request) where T : API.IResponsable
        {
            var response = await httpClient.SendAsync(request.ToHttpRequestMessage());

            var json = await response.Content.ReadAsStringAsync();

            return(JsonConvert.DeserializeObject <T>(json));
        }
Exemplo n.º 2
0
        public async Task <string> SendRequestAsStringAsync(API.IRequestable request)
        {
            var response = await httpClient.SendAsync(request.ToHttpRequestMessage());

            var json = await response.Content.ReadAsStringAsync();

            var obj = JsonConvert.DeserializeObject(json);

            return(JsonConvert.SerializeObject(obj, Formatting.Indented));
        }