I could do a simple soap server with php on my ubuntu server. On a special client soap, I get from a function the temperature of my OWFS ( One wire), but from now with this method I can get what I want on my ubuntu server. There is a way to have a soap request without a soap client.
It’s CURL !
So someone could help me to transform in lua this syntaxe:
curl -X POST -d @req.txthttp://example.org/server
-------------------------------------------------------------------------------------
-- Execute the command and return the stdout.
-------------------------------------------------------------------------------------
function execute (command)
local file = io.popen (command)
local data = file:read ("*a")
file:close()
-- We want to return nil instead of a empty string for easier debugging.
if (data == "") then
data = nil
end
return data
end
In you example, this is how the Lua code would look like:
local command = "curl -X POST -d @req.txt http://example.org/server"
local output = execute (command)
My apologies for my questions, but I have to make some progresses with my vera2. I discover more and more, I will see what I will do with it days after days. Vera is a very great device with big potential if we create some plugins.
Does I have to create the function execute (command) or it is already in vera functions (you say use so I think, it’s already there)?