Closed nkh closed 6 months ago
The only difference between the two commands I could think of is the content-type header. Could you try using the --form
option to set the content-type to application/x-www-form-urlencoded
?
xh :4266 --raw 'put(x)' --form
@ducaale that gives the same result
FYI: the sequence is send to fzf --listen 4266
fzf implements its own HTTP server that seems to have some odd behavior even if I just talk to it with netcat.
The request notably does work (on my machine). fzf does what it's told. But xh doesn't like it when fzf unceremoniously closes the connection thinks the response ends too early.
This is almost certainly a fzf bug, though a nitpicky one that they may or may not be interested in fixing.
@blyxxyz It indeed does do what it's told to do.
I'll report it to the fzf project.
OK, I found the problem. fzf's response is missing a CRLF after the header section. It should send HTTP/1.1 200 OK\r\n\r\n
but it only sends HTTP/1.1 200 OK\r\n
. Most HTTP implementations don't seem to mind but hyper is very pedantic.
I've submitted a PR: https://github.com/junegunn/fzf/pull/3542
Nice find!
Hi, I'm trying to replace he following curl command with an xh command.
I've tried
but I get
while curl succeeds.