/// <summary> /// Download the given uri and then extracts its title. /// </summary> public async Task <string> GetUrlTitleAsync(Uri uri) { if (uri == null) { throw new ArgumentNullException(nameof(uri)); } var result = await _downloaderService.DownloadPageAsync(uri.ToString()); return(GetHtmlPageTitle(result.Data)); }
public async Task <IActionResult> DownloadFile() { var url = Url.Action(nameof(Index), typeof(DownloaderServiceController).ControllerName(), null, Request.Scheme); var result = await _downloaderService.DownloadPageAsync(url, new AutoRetriesPolicy { MaxRequestAutoRetries = 2, AutoRetriesDelay = TimeSpan.FromSeconds(3) }); return(Content(result.Data)); }
/// <summary> /// Download the given uri and then extracts its title. /// </summary> public async Task <string> GetUrlTitleAsync(Uri uri) { var result = await _downloaderService.DownloadPageAsync(uri.ToString()); return(GetHtmlPageTitle(result.Data)); }