An action block that performs a HTTP request, download content from the internet.
The fiber will pause until the download has completed.
The request content body and request content path can both be arrays thereof,
the elements of both are interleaved beginning with body then file, body and so on.
If only one array is used, or one is longer that the other, the (remaining) elements are simply concatenated. null
elements are ignored.
This can be used to concatenate files before upload, or send a multipart request,
e.g. POST a web form which submit files.
If the body is expected to be large, enable chunked transfer encoding by including a { "Transfer-Encoding": "chunked" }
request header.
The save response controls if, and how the response content will be saved.
If Save to file, then the path can be set to an existing or new file, or to a directory where the file will be placed with an automatic name.
The path to the actual file downloaded is assigned to the response content variable.
Avoid including an "Accept-Encoding"
request header as that will explicitly disable automatic decompression of the response content, e.g. if it’s using gzip.
Always check the response status code to ensure an expected response, usually 200
for success.
Use the Failure catch block to handle potential connection issue.
If an EACCES SocketException
failure occurs, try disabling the system “Data Saver” feature, for just Automate or globally.
Note! Saving large responses to variable may cause performance issues since it can be included in the fiber when it’s stored in the internal database.
"Content-Disposition"
.