Skip to main content

DownloadFileFromHTTP

Downloads data from the given HTTP URL. If context is canceled then the request will be canceled.

def DownloadFileFromHTTP(
ctx: context.Context,
ref: storage.DataReference
) - > io.ReadCloser

Downloads data from the given HTTP URL. If context is canceled then the request will be canceled.

Parameters​

NameTypeDescription
ctxcontext.ContextThe context for the HTTP request, used to manage cancellation and timeouts.
refstorage.DataReferenceThe data reference containing the HTTP URL from which to download the file.

Returns​

TypeDescription
io.ReadCloserA ReadCloser containing the body of the HTTP response, or an error if the download fails.