MINOR: httpclient: support payload within a buffer

httpclient_req_gen() takes a payload argument which can be use to put a
payload in the request. This payload can only fit a request buffer.

This payload can also be specified by the "body" named parameter within
the lua. httpclient.

It is also used within the CLI httpclient when specified as a CLI
payload with "<<".
This commit is contained in:
William Lallemand
2021-10-25 19:48:37 +02:00
parent b4d0cd02c1
commit dec25c3e14
4 changed files with 24 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ local function cron()
core.Debug('CRON port:' .. vtc_port)
local httpclient = core.httpclient()
local response = httpclient:get{url="http://127.0.0.1:" .. vtc_port}
local response = httpclient:get{url="http://127.0.0.1:" .. vtc_port, body="foobar-is-the-new-toto"}
core.Info("Received: " .. response.body)
end