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.

Last Post!

kwando

kwando

I would also recommend req :slight_smile: still not 1.0 though.

Where Next?

Popular in Chat/Questions Top

jsnoble
I come from a javascript background and I just starting learning elixir. I went through the basic tutorials but I want something deeper. ...
New
AstonJ
It’s been a while since we asked this - I’m sure others (especially newcomers to the language) will be interested to hear how you’ve all ...
New
Fl4m3Ph03n1x
Background Hello all! So after my controversial introduction with Learning Elixir, frst impressions ( plz don't kill me ! ) - #39 by easc...
New
Fl4m3Ph03n1x
Background After following the communitiy suggestion, I bought the Elixir in Action 2nd Edition book and I am about to finish it now. I ...
New
New
venomnert
Background I have been a backend elixir developer for about 3 years now. I have been mainly working on simple CRUD applications. Context...
New
AstonJ
It finally feels like I’ve got some time to catch up on my reading - though I am sure lots of people will be wondering the same: what are...
New

Other popular topics Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
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

We're in Beta

About us Mission Statement