What does HackerNews think of xh?

Friendly and fast tool for sending HTTP requests

Language: Rust

#28 in Rust
#9 in Terminal
HTTPie (the CLI version) is great and was a big improvement for me over cURL.

However, I ended up switching to xh[1] as it's significantly faster and I prefer its output.

Although I might give this Desktop version a try for more complex APIs.

https://github.com/ducaale/xh

No, but unless portability is a concern or you're massively familiar with curl, you might want to consider xh. It's much more intuitive.

https://github.com/ducaale/xh

Couple more things wget can do that curl can't.

1. wget can resolve onion links. curl can't(yet). You'll get a

    curl: (6) Not resolving .onion address (RFC 7686)

2. curl has problems parsing unicode characters

    curl -s -A "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0" https://old.reddit.com/r/GonewildAudible/comments/wznkop/f4m_mi_coño_esta_mojada_summer22tomboy/.json
will give you a

    {"message": "Bad Request", "error": 400}
 
wget on the other hand, automatically converts the ñ to UTF-8 hex - %C3%B1 - and resolves the link perfectly.

I've searched the curl manpage and couldn't find a way to solve this. Please help.

I'm having to use `xh --curl` [1] to "fix" the links before I pass them to curl.

[1] https://github.com/ducaale/xh

Speaking of command line HTTP handling, my favorite tool for that is Httpie[1], or rather its faster Rust rewrite, XH[2]. It lets you issue HTTP requests from the command line with much nicer, more HTTP-like syntax than CURL and without the need to learn so many switches. If you already know curl well, it probably won't be of much use, but it's far, far more intuitive for casual use.

[1] https://httpie.io/ [2] https://github.com/ducaale/xh

While not a rewrite - one recent tool for making http requests which i quite enjoy is:

https://github.com/ducaale/xh

It's basically python httpie rewritten in rust. my only gripe is that i keep forgetting that it exists - and that "xh" is for http and "xhs" is for https.

So i frequently end up with curl anyway:)

Is your primary differentiator to existing Rust CLI HTTP clients like https://github.com/ducaale/xh that it does not have any dependencies?
I have recently been trying a port of HTTPie in Rust, xh [0] (which is needlessly hard to find in a websearch). I am a Python guy, but love having single executable tools.

[0] https://github.com/ducaale/xh

Instead of curl or even httpie, I use xh[0]. It builds on a lot of the same features as httpie, but is faster and offers a --curl flag to translate into a curl command that you can share with colleagues.

[0]: https://github.com/ducaale/xh

> It would be better if it was written in rust

There is a project to rewrite HTTPie in Rust: https://github.com/ducaale/xh

(Disclaimer: I'm one of the developers)