Exemple #1
0
        public async Task <RestResponse <T> > GetAsync <T>(string route, CancellationToken cancelToken)
        {
            var rawResponse = await _client.GetAsync(route, cancelToken);

            var response = await ResponseDeserializer.DeserializeAsync <T>(rawResponse);

            return(response);
        }
Exemple #2
0
        public async Task <RestResponse <TResponse> > PostAsync <TRequest, TResponse>(string route, TRequest body, CancellationToken cancelToken)
        {
            var requestContent = ContentEncoder.Encode(body);
            var rawResponse    = await _client.PostAsync(route, requestContent, cancelToken);

            var response = await ResponseDeserializer.DeserializeAsync <TResponse>(rawResponse);

            return(response);
        }