1. --!movie
  2. --!encoding=utf-8
  3.  
  4. global $
  5.  
  6. ----------------------------------------
  7. -- Send data with HTTP PUT method (synchronous or blocking mode)
  8. ----------------------------------------
  9. on startMovie
  10.     _player.debugPlaybackEnabled = 1
  11.  
  12.     -- libs
  13.     $.import("curl")
  14.  
  15.     -- get a CURL handle (xtra instance)
  16.     ch = $.curl.init()
  17.  
  18.     -- specify options
  19.     ch.setOption($.curl.CURLOPT.URL, "http://valentin.dasdeck.com/xtras/curl_xtra/.test/put.php")
  20.     ch.setOption($.curl.CURLOPT.UPLOAD, 1)
  21.  
  22.     -- upload this script file
  23.     ch.setSourceFile($.PATH & "http_put.lsw")
  24.  
  25.     -- returnMode: 0=return error code (=default), 1=return data
  26.     res = ch.exec(1)
  27.  
  28.     if integerP(res) then
  29.         put "ERROR:" && curl_error(res)
  30.     else
  31.         put "RESULT:" && res.readRawString(res.length)
  32.         put "SPEED_UPLOAD:" && ch.getInfo($.curl.CURLINFO.SPEED_UPLOAD)
  33. --      put "SPEED_DOWNLOAD:" && ch.getInfo($.curl.CURLINFO.SPEED_DOWNLOAD)
  34. --      put "TOTAL_TIME:" && ch.getInfo($.curl.CURLINFO.TOTAL_TIME)
  35.     end if
  36. end
  37.  
[raw code]