]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: httpclient/cli: add --htx option
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 30 Jan 2025 16:15:36 +0000 (17:15 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Jul 2025 14:33:38 +0000 (16:33 +0200)
commit0f1c206b8fe2ba19f71337f7c48cc937233266c8
tree1da6ecb778507f984221b4e60fc9a8acab879054
parent3e05e20029566d5543311610648f54c4a4e8d191
MINOR: httpclient/cli: add --htx option

Use the new HTTPCLIENT_O_RES_HTX flag when using the CLI httpclient with
--htx.

It allows to process directly the response in HTX, then the htx_dump()
function is used to display a debug output.

Example:

echo "httpclient --htx GET https://haproxy.org" | socat /tmp/haproxy.sock
 htx=0x79fd72a2e200(size=16336,data=139,used=6,wrap=NO,flags=0x00000010,extra=0,first=0,head=0,tail=5,tail_addr=139,head_addr=0,end_addr=0)
[0] type=HTX_BLK_RES_SL    - size=31     - addr=0      HTTP/2.0 301
[1] type=HTX_BLK_HDR       - size=15     - addr=31     content-length: 0
[2] type=HTX_BLK_HDR       - size=32     - addr=46     location: https://www.haproxy.org/
[3] type=HTX_BLK_HDR       - size=25     - addr=78     alt-svc: h3=":443"; ma=3600
[4] type=HTX_BLK_HDR       - size=35     - addr=103    set-cookie: served=2:TLSv1.3+TCP:IPv4
[5] type=HTX_BLK_EOH       - size=1      - addr=138    <empty>
doc/management.txt
src/httpclient_cli.c