From c764aa9641dc834dd63f24e161935c71dc76214d Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Wed, 19 Aug 2026 20:36:58 +0200 Subject: [PATCH] MINOR: haload: add -get/-head/-post options to select the HTTP method Only GET (or HEAD globally via -I) could be sent before. Add -get, -head and -post as positional options, like -h(0|1|2|2c|3), to pick the method and, for POST, the body size, per URL. The method and body size are stored per URL path (struct hld_path) so distinct paths sharing the same server address keep their own settings. The POST body is filled from a static buffer, streamed across several output buffers for large sizes, with a matching Content-Length header. Remove -I, superseded by -head. Update doc/haload.txt. --- doc/haload.txt | 8 ++- include/haproxy/haload.h | 5 +- include/haproxy/hldstream-t.h | 5 ++ src/haload.c | 113 ++++++++++++++++++++++++++++++---- src/haload_init.c | 39 +++++++++--- 5 files changed, 149 insertions(+), 21 deletions(-) diff --git a/doc/haload.txt b/doc/haload.txt index 66dafb7c3..99e8a8a39 100644 --- a/doc/haload.txt +++ b/doc/haload.txt @@ -61,6 +61,9 @@ HALoad displays its usage when run without argument or wrong arguments: -h(0|1|2|2c|3) use h0 (hq-interop for QUIC), h1, h2, h2c or h3 (QUIC/TCP) protocols (*) -(0|1|2|2c|3) same as above (*) + -get use GET method (default) (*) + -head use HEAD method instead of GET (*) + -post use POST method, sending bytes of body (*) -hs show HTTP status codes distribution -hsv show HTTP status codes distribution ((global + per HTTP version) -l enable long output format; double for raw values @@ -73,7 +76,6 @@ HALoad displays its usage when run without argument or wrong arguments: -w