Version 0.98 BETA

This commit is contained in:
OTCv8
2019-10-04 11:08:01 +02:00
parent 2b925dc52d
commit bb3782fb03
17 changed files with 271 additions and 43 deletions

View File

@@ -8,13 +8,13 @@ HTTP = {
function HTTP.get(url, callback)
local operation = g_http.get(url, HTTP.timeout)
HTTP.operations[operation] = {type="get", url=url, callback=callback}
return opreation
return operation
end
function HTTP.getJSON(url, callback)
local operation = g_http.get(url, HTTP.timeout)
HTTP.operations[operation] = {type="get", json=true, url=url, callback=callback}
return opreation
return operation
end
function HTTP.post(url, data, callback)
@@ -23,7 +23,7 @@ function HTTP.post(url, data, callback)
end
local operation = g_http.post(url, data, HTTP.timeout)
HTTP.operations[operation] = {type="post", url=url, callback=callback}
return opreation
return operation
end
function HTTP.postJSON(url, data, callback)
@@ -32,13 +32,13 @@ function HTTP.postJSON(url, data, callback)
end
local operation = g_http.post(url, data, HTTP.timeout)
HTTP.operations[operation] = {type="post", json=true, url=url, callback=callback}
return opreation
return operation
end
function HTTP.download(url, file, callback, progressCallback)
local operation = g_http.download(url, file, HTTP.timeout)
HTTP.operations[operation] = {type="download", url=url, file=file, callback=callback, progressCallback=progressCallback}
return opreation
return operation
end
function HTTP.downloadImage(url, callback)
@@ -52,7 +52,7 @@ function HTTP.downloadImage(url, callback)
HTTP.imageId = HTTP.imageId + 1
local operation = g_http.download(url, file, HTTP.timeout)
HTTP.operations[operation] = {type="image", url=url, file=file, callback=callback}
return opreation
return operation
end
function HTTP.progress(operationId)
@@ -154,4 +154,5 @@ connect(g_http,
onPostProgress = HTTP.onPostProgress,
onDownload = HTTP.onDownload,
onDownloadProgress = HTTP.onDownloadProgress
})
})