Fork `basement`? As `baseplate`?

In basically any other language as well, foreign bindings to curl or the like are how http is often done, and even then, in those languages, shelling out to curl is significantly more robust. It is simply that because haskell cares more about code that is both statically compiled and cross-platform the desire for a fully native library is stronger.

That said, let me explain, based on experience, why shelling out to curl is more robust than linking libcurl. Libcurl has the basic power in terms of protocol and settings as curl-the-executable of course. However, it does not have those settings configured as users would desire them. It needs special flags or multiple calls to discover where certificates are and load them robustly, to follow redirect paths which the binary client will follow automatically, etc. This is particularly striking/onerous with proxy settings, where depending on OS and version, they may be in a ton of different places, in one of a few formats. Libcurl doesn’t automatically search all the different places different systems may have proxies configured (especially in the presence of proxies set by endpoint security systems), but the executable has that additional logic wired in. The library is a swiss-army-knife for configuring and then making precise HTTP calls, but the executable is the tool that is able to interpret ā€œdo all the things you need to in order to retrieve this remote fileā€ which is a much broader task. Effectively, no matter what language you are in, if you want to make your program robust under the greatest number of possible end-user situations, then you will be best served by shelling out to curl.

Is there a Haskell library that wraps shelling out to curl? Or do I have to munge strings in and out and callProcess myself?

I don’t really care if that is the underlying implementation of HTTP in Haskell. Your reasons make sense to me. But if literally shelling out is the state of the art Haskell HTTP frontend, we are in bad shape hahahaha

Maybe that’s not too much of a bad idea in fact. There’s some significant code regarding this in both Cabal and GHCup that could be factored out. Dealing with all the cli options (especially in a portable manner) is not easy, then all the stuff around etags etc.

But my guess is that any such wrapper would be fairly opinionated and simplified.

But I feel we’re going increasingly off-topic.

It sounds like shelling out to curl is a good idea (language agnostic), so yeah - a typesafe wrapper would be great!