HttpAliases.

DownloadFile(ICakeContext, string, FilePath, DownloadFileSettings) Method

Summary

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

Syntax

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

Examples

var outputPath = File("./index.html");
DownloadFile("http://www.example.org/index.html", 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 string The URL of the resource to download.
outputPath FilePath The output path.
settings DownloadFileSettings The settings.

Return Value

Type Description
void