Hardhat - an opinionated, production-ready HTTP client for Elixir services

I’m proud to announce the 1.0 release of Hardhat, an opinionated, production-ready HTTP client library for Elixir services.

  • Opinionated: includes default behavior on top of basic HTTP client semantics, some of which is required

  • Production-ready: the behavior included is focused on client-side resilience and has been proven effective in production settings

  • HTTP: only focused on HTTP 1/2 clients, not gRPC or other protocols

  • For Elixir services: an effective component for large Elixir applications that interact with other services in a micro-services architecture or consume third-party HTTP APIs

I strongly encourage you to read the main documentation page for more details about usage and motivations behind the creation of the library.

I have written this library and its documentation over the last four months mostly while live-streaming on Twitch. I’d like to thank all of my friends, former colleagues, and lurkers who helped out along the way.

Drop any questions you have below, I’ll try to answer them as I have time!


Great job. Batteries included solution is cool, though I am not a fan of Tesla or middleware based solutions

Thank you!

For me, the choice was as easy now as it was the first time I wrote Hardhat. Tesla and its middleware pattern gives the most flexibility to construct the client in the way that I wanted while letting consumers of the library extend and customize to their needs. That said, it does have downsides, especially when functionality is cross-cutting or interacts in surprising ways (like retries and circuit-breaking).