Posts: 169
Threads: 58
Joined: Oct 2017
Reputation:
0
Hi all,
is ther any way to add a "body" string as parameter of the http.request, as it's possible to do it with "header" ?
Many thank's in advance for your help.
All the best from France
Posts: 7764
Threads: 42
Joined: Jun 2015
Reputation:
447
Second parameter for the request function is body when using simple form: http.request(url, body)
Posts: 169
Threads: 58
Joined: Oct 2017
Reputation:
0
I thnik I'm not using a simple form...
I have to integrate as body '{"time":"2020-06-09 16:27:36"}' for a REST process, in the following lines.
local res, err = http.request({
url = url,
method = 'POST',
-- protocol = 'tlsv12' -- only for old LM firmware
headers = headers,
sink = ltn12.sink.table(resp),
source = ltn12.source.string(data)
})
Posts: 169
Threads: 58
Joined: Oct 2017
Reputation:
0
Ok Admin,
I founded the "source" parameter to pass my REST/Json command body.
Know it works fine !
Thank's and have a good end of week.