The size of HTTPS requests is currently limited by the host system's RAM size.
This approach would not work when RAM is limited or when downloading very large files.
Lua's Socket library has the "sink" option which can stream the response directly to a file.