HttpDownloader class final

Downloads files from HTTP(S) URLs with retry, proxy support, and redirect following.

All downloads are written to a temporary file first, then atomically renamed to the target path.

Constructors

HttpDownloader({HttpDownloadPolicy policy = const HttpDownloadPolicy(), void onProgress(int bytesReceived, int? totalBytes)?})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
onProgress → void Function(int bytesReceived, int? totalBytes)?
Optional progress callback: (bytesDownloaded, totalBytes).
final
policy HttpDownloadPolicy
Download policy (timeouts, retries, size limits).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

download(Uri url, File targetPath, {Map<String, String> headers = const {}}) Future<void>
Downloads the file at url to targetPath.
downloadReleaseArtifact({required ReleaseSource source, required String archiveName, required File targetPath, Logger? logger}) Future<void>
Downloads a release artifact from a ReleaseSource.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited