Method BeginDownloadAsync
| Edit this page View SourceBeginDownloadAsync(string, Uri, HttpMessageHandler?, CancellationToken)
Initiates a download to the specified file from the specified URL
Declaration
public static Task<FileDownloadTask> BeginDownloadAsync(string destinationPath, Uri requestUri, HttpMessageHandler? handler = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | destinationPath | File where the download should be saved to. |
Uri | requestUri | URL to download |
HttpMessageHandler | handler | Optional custom HTTP handler to be used. |
CancellationToken | cancellationToken | Cancellation token for starting the download. Note that once download has started, use CancelAsync() to cancel an active download. |
Returns
Type | Description |
---|---|
Task<FileDownloadTask> | FileDownloadTask |
Exceptions
Type | Condition |
---|---|
IOException | The destination file already exists |