public async Task <ShortUrlEntity> CreateShortUrl(ShortUrlRequest shortUrlRequest) { var result = await _urlSecuredService.CreateShortUrl(shortUrlRequest); result.ShortUrl.Replace(_configuration.GetSection("ActualDomain").Value, _configuration.GetSection("Domain").Value); return(result); }
public async Task <ShortUrlList> CreateShortUrl(ShortUrlRequest shortUrlRequest) { CancellationToken cancellationToken = new CancellationToken(); var response = await _client.PostAsJsonAsync($"/api/UrlShortener", shortUrlRequest, cancellationToken); var resultList = await response.Content.ReadAsStringAsync(); return(JsonConvert.DeserializeObject <ShortUrlList>(resultList)); }
public async Task <ShortUrlList> CreateShortUrl(ShortUrlRequest shortUrlRequest) { var result = await _urlSecuredService.CreateShortUrl(shortUrlRequest); return(result); }