What is the equivalent of Python's "Requests" module for Erlang?

Is there any module for Erlang that works like Python’s “Requests” module?

2 Likes

I tend to just use the http client module directly.
httpc module

2 Likes

You have choices;

httpc - https://www.erlang.org/doc/man/httpc.html (built in)
hackney: https://hex.pm/packages/hackney
gun: https://hex.pm/packages/gun
lhttpc: https://hex.pm/packages/lhttpc
dlhttpc: https://github.com/ferd/dlhttpc

Personally I use hackney unless I need long-lived http2 connections to external systems, in which case, gun

4 Likes

Thanks. At first glance it seems like, one can change headers, use proxy and also implement proxy authentication. Please correct me if I’m wrong.

1 Like

Thanks for additional info, I’ll check them.

1 Like

GitHub - ninenines/gun: HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP. HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP.

1 Like
2 Likes

Thanks for both of your replies.

1 Like

That’s a great way to split them up. gun is also really good for outgoing websocket connections, as it provides a really detailed level of messaging about all the steps and states of the conversation, so you can get into really fine-grained control of what you’re doing.

1 Like