User Tools

Site Tools


lua:curl_example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lua:curl_example [2023/10/26 14:16] – [Writing some file onto WebHMI filesystem] emozolyaklua:curl_example [2024/01/18 12:58] (current) atolstov
Line 1: Line 1:
 +====== Getting some data from WebHMI itself using API ======
 +
 <code lua> <code lua>
-    +local res = ""    
 local c = cURL.easy_init() local c = cURL.easy_init()
 c:setopt{ url = 'http://127.0.0.1/api/event-data/' .. event, c:setopt{ url = 'http://127.0.0.1/api/event-data/' .. event,
Line 12: Line 14:
          }          }
          
-    local res = ""+
     c:perform{writefunction = function(str)     c:perform{writefunction = function(str)
             res = res .. str             res = res .. str
lua/curl_example.1698329766.txt.gz · Last modified: 2023/10/26 14:16 by emozolyak

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki