jace

jace

What HTTP client library to start with as a Elixir beginner?

I wanted to write a library for interacting with a Web API as a practical way of learning Elixir. However, there seem to be a lot of different open source HTTP client libraries I can use! I am unsure what to use to start off with. I do want to use something basic so that I learn as much as possible while working on my project.

I noticed the Tesla library but I was wondering if anyone has any other lower level recommendations.

Most Liked

sergio

sergio

I recommend Req. Has a ton of concise out of the box defaults, you generally don’t worry about the minutiae. It retries etc, all configurable but all with great defaults for your 99% cases.

Example:

Req.get!(req_url,
  headers: [
    {"user-agent",
     "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"}
  ]
).body
thojanssens1

thojanssens1

I would recommend Finch, which is a layer on top of Mint. They are both fully written in Elixir, but I feel Mint is too low level if you want an easy to use API.

dimitarvp

dimitarvp

finch is pretty nice and allows you good control and branching on responses. It strikes a good balance between control and brevity IMO.

Many people started using req lately. I checked it out quickly and liked what I saw, though never tried it personally.

That being said, nowadays I’d use Tesla and pick an underlying HTTP client for it, which would be Finch. I simply like having the same dev experience everywhere where HTTP client is needed. Though that’s not an accepted fact, just my own preference.

Where Next?

Popular in Chat/Questions Top

sadcad
I love the Phoenix and Elixir docs, but I always tend to learn faster when I watch a video of someone explaining things and then I implem...
New
Lincxx
Hello, I’m sure this has been asked a bunch, but where to start. I do prefer vodeos over books, but recently I have found books to be mor...
New
dopomecana
The title of this topic may sound silly at the first glance. But why I trying to ask you guys is how to go to the next level? I am curre...
New
New
SavagePixie
I was wondering if there are any beginner-friendly, exercise-based resources for learning Elixir out there. I’m looking for something lik...
New
Kielo
Hi, I run a language learning blog and would like to learn how to code so I can create an app to help English speakers learn French. I ...
New
Scoty
Hey, I am currently reading Programming Elixir and I am doing one of the exercises where you should write a solution to the “I’m thinkin...
New
Chawki
Hi,i’m new to elixir. i’m searching elixir small programs to try it out my self,Is any good resources out there? Thank you.
New
InkFlo
Hi everyone, This year I’m graduated from Bachelor Degree (in computer science) from France (not really a bachelor, the exact term is “L...
New
Besto
I’ve been trying to start learning Elixir for a couple of weeks while I develop a tiny project I have on node.js, but every time I try to...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29603 241
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
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
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
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

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement