Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Download-Http

Downloads a file from a specified URL using an HTTP GET.

Script usage:

Download-Http(
	FileName: <text>,
	Url: <text>,
	[LogResponseBody: <true/false>],
	[ErrorStatusCodes: <text>],
	[ResponseBody: <text>],
	[RequestHeaders: <%(key1: value1, ...)>],
	[MaxResponseLength: <integer>],
	[ProxyRequest: <true/false>],
	[Credentials: <text>],
	[UserName: <text>],
	[Password: <text>],
	[IgnoreSslErrors: <true/false>]
);

This operation may be prefixed with HTTP::, although this is a built-in namespace and isn't really necessary.

Arguments:

NameFormatScript UsageUsage Notes
File name
text
FileName
The destination path for the downloaded file. This argument is required.
URL (default)
text
Url
This argument is required.
Log response body
true/false
LogResponseBody
Error status codes
text
ErrorStatusCodes
Comma-separated status codes (or ranges in the form of start:end) that should indicate this action has failed. For example, a value of "401,500:599" will fail on all server errors and also when "HTTP Unauthorized" is returned. The default is 400:599. Value note: "400:599".
Store response as
text
ResponseBody
Value note: "Do not store response body as variable".
Request headers
%(key1: value1, ...)
RequestHeaders
Max response length
integer
MaxResponseLength
Default value is "1000".
Use server in context
true/false
ProxyRequest
When selected, this will proxy the HTTP calls through the server is in context instead of using the server Otter or BuildMaster is installed on. Default value is "True".
Credentials
text
Credentials
User name
text
UserName
Not specifying will "Use user name from credential".
Password
text
Password
Not specifying will "Use password from credential".
Ignore SSL Errors
true/false
IgnoreSslErrors
Default value is "False".

Example:


# downloads a file from example.org service endpoint
Download-Http http://example.org/upload-service/v3/hdars (
    To: ReleaseNotes.xml
);