--!movie
--!encoding=utf-8
global $
----------------------------------------
-- Send data with HTTP PUT method (synchronous or blocking mode)
----------------------------------------
on startMovie
_player.debugPlaybackEnabled = 1
-- libs
$.import("curl")
-- get a CURL handle (xtra instance)
ch = $.curl.init()
-- specify options
ch.setOption($.curl.CURLOPT.URL, "http://valentin.dasdeck.com/xtras/curl_xtra/.test/put.php")
ch.setOption($.curl.CURLOPT.UPLOAD, 1)
-- upload this script file
ch.setSourceFile($.PATH & "http_put.lsw")
-- returnMode: 0=return error code (=default), 1=return data
res = ch.exec(1)
if integerP(res) then
put "ERROR:" && curl_error(res)
else
put "RESULT:" && res.readRawString(res.length)
put "SPEED_UPLOAD:" && ch.getInfo($.curl.CURLINFO.SPEED_UPLOAD)
-- put "SPEED_DOWNLOAD:" && ch.getInfo($.curl.CURLINFO.SPEED_DOWNLOAD)
-- put "TOTAL_TIME:" && ch.getInfo($.curl.CURLINFO.TOTAL_TIME)
end if
end