1. --!movie
  2. --!encoding=utf-8
  3.  
  4. global $
  5.  
  6. ----------------------------------------
  7. -- Send data with http get (synchronous or blocking mode)
  8. -- (triggers network error by using a non-existant domain)
  9. ----------------------------------------
  10. on startMovie
  11.     _player.debugPlaybackEnabled = 1
  12.  
  13.     -- libs
  14.     $.import("curl")
  15.  
  16.     -- get a CURL handle (xtra instance)
  17.     ch = $.curl.init()
  18.  
  19.     -- specify options
  20.     ch.setOption($.curl.CURLOPT.URL, "http://doesntexist.xxxrtzr.com/") -- test network error handling
  21.  
  22.     -- returnMode: 0=return error code (=default), 1=return data
  23.     res = ch.exec(1)
  24.  
  25.     if integerP(res) then
  26.         put "ERROR:" && curl_error(res)
  27.     else
  28.         put "RESULT:" && res.readRawString(res.length)
  29. --      put "SPEED_UPLOAD:" && ch.getInfo($.curl.CURLINFO.SPEED_UPLOAD)
  30. --      put "TOTAL_TIME:" && ch.getInfo($.curl.CURLINFO.TOTAL_TIME)
  31.     end if
  32. end
  33.  
[raw code]