HttpAliases.

DownloadFile(ICakeContext, Uri, FilePath, DownloadFileSettings) Method

Summary

Downloads the specified resource over HTTP to the specified output path.
Namespace
Cake.Common.Net
Containing Type
HttpAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Download")]
public static void DownloadFile(this ICakeContext context, Uri address, FilePath outputPath, DownloadFileSettings settings)

Examples

var address = new Uri("http://www.example.org/index.html");
var outputPath = File("./index.html");
DownloadFile(address, outputPath, new DownloadFileSettings()
{
    Username = "bob",
    Password = "builder"
});

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeAliasCategoryAttribute An attribute used for documentation of alias methods/properties.

Parameters

Name Type Description
context ICakeContext The context.
address Uri The URL of the resource to download.
outputPath FilePath The output path.
settings DownloadFileSettings The settings.

Return Value

Type Description
void