itzmidinesh

itzmidinesh

Preferred HTTP library: Req or HTTPoison?

Hi all,

I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison.

Req looks modern and composable, which is appealing. But, HTTPoison has been around for a long time and seems to be a battle-tested choice. I also noticed that HTTPoison has only one dependency which makes it attractive for keeping things lightweight.

I’d love to hear what the community prefers in 2025:

  • Which library do you use and why?
  • Any caveats, issues or limitations you’ve run into with either?

Thanks in advance!

Marked As Solved

sabiwara

sabiwara

Elixir Core Team

You might want to read this deep-dive on the topic:

I also noticed that HTTPoison has only one dependency which makes it attractive for keeping things lightweight.

It may have only one direct dependency (:hackney), but :hackney itself comes with several dependencies (mentioned in the article above too).

Also Liked

garrison

garrison

I would go with Req for new projects at this point. It has a wonderful API and buy-in from the right people, so we know it will be used and maintained. The only downside is it’s still not a stable release, but it’s been pretty stable for the last year or so now so I don’t expect any substantial breaking changes or anything at this point. I’ve personally switched over (I was previously rolling my own on top of Finch) and the batteries-included API is very nice.

Also: Req is a pure-Elixir stack underneath (Finch, Mint). Which doesn’t really matter but it’s cool!

adamu

adamu

Tesla is pretty underrated IMO, and it no longer “relies a bit too much on module-based configuration and meta-programming”, citied as downsides in that article.

Where Next?

Popular in Questions Top

New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54260 488
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

We're in Beta

About us Mission Statement