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

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
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
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
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
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
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
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement