[HttpResponse]|[nil] response, [string] error = snetwork.fileget(url, saveFilePath, headers, progressCallback)


Performs a GET web request synchronously.

Parameters


url

string

The URL to request.

saveFilePath

string

The file path to save the response body to.

progressCallback

nil | "fun(downloadDone:integer,

downloadTotal:integer, uploadDone:integer, uploadTotal:integer) A function which will be called whenever progress is made on the request.

Return Value


response

HttpResponse | nil

The response from the server.

error

string

The error message if the request failed.