HTTP support
OTClientV8 HTTP protocol
Available functions
HTTP.get(url, callback)
HTTP.getJSON(url, callback) -- website should return json
HTTP.post(url, data, callback)
HTTP.postJSON(url, data, callback) -- data should be a table {} and website should return json
HTTP.download(url, file, downloadCallback, progressCallback) -- progressCallback can be null
HTTP.downloadImage(url, downloadImageCallback)
HTTP.cancel(operationId)Callbacks
function callback(data, err)
if err then
-- handle error, if err is not null then err is a string
return
end
-- handle data
-- if it's data from getJSON/postJSON then data is a table {}
endSupport for images from base64
Timeout
Examples
Regex
Last updated