mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-04 07:13:30 +02:00
MINOR: httpclient/lua: support more HTTP methods
Add support for HEAD/PUT/POST/DELETE method with the lua httpclient. This patch use the httpclient_req_gen() function with a different meth parameter to implement this. Also change the reg-test to support a POST request with a body.
This commit is contained in:
@@ -20,8 +20,14 @@ local function cron()
|
||||
end
|
||||
core.Debug('CRON port:' .. vtc_port)
|
||||
|
||||
local body = ""
|
||||
|
||||
for i = 0, 200 do
|
||||
body = body .. i .. ' ABCDEFGHIJKLMNOPQRSTUVWXYZ\n'
|
||||
end
|
||||
|
||||
local httpclient = core.httpclient()
|
||||
local response = httpclient:get{url="http://127.0.0.1:" .. vtc_port, body="foobar-is-the-new-toto"}
|
||||
local response = httpclient:post{url="http://127.0.0.1:" .. vtc_port, body=body}
|
||||
|
||||
core.Info("Received: " .. response.body)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user