Downloads the file at the given URL asynchronously.
Example
public static int main (string[] args) {
var url = "https://example.com/foo.tgz";
var output_file = GLib.File.new_for_path ("./foo.tgz");
var context = new Catalyst.Http.DownloadContext (url, output_file);
context.progress.connect ((bytes_read, total_bytes) => {
// ...
});
context.complete.connect (() => {
// ...
});
context.failed.connect ((message, status_code) => {
// ...
});
Catalyst.HttpUtils.download_file_async.begin (context, null, (obj, res) => {
Catalyst.HttpUtils.download_file_async.end (res);
});
return 0;
}
context |
a Catalyst.Http.DownloadContext providing request details as well as a means of tracking progress and signaling completion/failure |
cancellable |
a GLib.Cancellable |