This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

http.request & body
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
Second parameter for the request function is body when using simple form: http.request(url, body)
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)
See this:
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.

Forum Jump: