I agree that http.rb is wonderful. I do have one complaint I wish to register:
Successfully installed unf_ext-0.0.7.7
Successfully installed unf-0.1.4
Successfully installed domain_name-0.5.20190701
Successfully installed http-cookie-1.0.3
Successfully installed http-form_data-2.3.0
Successfully installed ffi-compiler-1.0.1
Building native extensions. This could take a while...
Successfully installed http-parser-1.2.1
Successfully installed http-4.4.1
8 gems installed
Eight gems for an http client. This offends me.
I don’t understand why. Each of those dependencies strikes me as something that could reasonably be used independently. I’d be very confused if a library e.g. implemented unicode normalization by itself.
Because 99% of the time, the user does not want to use them independently. They just want a full-featured HTTP client.
If the developer wants to use 8 different projects, version them all separately, maintain separate repos and release schedules that’s their call. IMO developers dramatically overvalue reuse (e.g. see all of the Node.js ecosystem) while I’ve grown to prefer one, simpler, batteries included experience.
the user might not, but developer who is writing a different library would appreciate having the pieces handy.