HttpAliases.

DownloadFile(ICakeContext, string, DownloadFileSettings) Method

Summary

Downloads the specified resource over HTTP to a temporary file with specified settings.
Namespace
Cake.Common.Net
Containing Type
HttpAliases

Syntax

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

Examples

var resource = DownloadFile("http://www.example.org/index.html", 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.
settings DownloadFileSettings The settings.

Return Value

Type Description
FilePath The path to the downloaded file.