示例#1
0
        public async Task <RetornoDto> GetContratoAsync(string token, string cpf)
        {
            _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
            var response = await _httpClient.GetAsync(_configuration.GetSection(Path.CONTRATO.ToString()).Value);

            return(await RetornoExtension.ToRetornoDtoAsync(response));
        }
示例#2
0
        public async Task <RetornoDto> GetTokenAsync(LoginDto login)
        {
            var response = await _httpClient.PostAsJsonAsync(_configuration.GetSection(Path.TOKEN.ToString()).Value, login);

            response.EnsureSuccessStatusCode();

            return(await RetornoExtension.ToRetornoDtoAsync(response));
        }
示例#3
0
        public async Task <RetornoDto> NegociacaoAsync(string token, NegociacaoDto negociacao)
        {
            _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
            var response = await _httpClient.PostAsJsonAsync(_configuration.GetSection(Path.NEGOCIACAO.ToString()).Value, negociacao);

            response.EnsureSuccessStatusCode();

            return(await RetornoExtension.ToRetornoDtoAsync(response));
        }