Skip to main content

HttpClient

Description:

  Represents an HTTP client.

downloadAsync

Type: Function.

Description:

  Downloads a file asynchronously from the specified URL and saves it to the specified path. Should be run in a coroutine.

Signature:

downloadAsync: function(self: HttpClient, url: string, fullPath: string, progress: function(current: integer, total: integer)): boolean

Parameters:

ParameterTypeDescription
urlstringThe URL of the file to download.
fullPathstringThe full path where the downloaded file should be saved.
progressstring[optional] A callback function that is called periodically to report the download progress. The function receives two parameters: current (the number of bytes downloaded so far) and total (the total number of bytes to be downloaded).

Returns:

Return TypeDescription
booleanA boolean value indicating whether the download was done successfully.