chulkilee

chulkilee

Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they work with HTTP..

HTTP client libraries

HTTP Client Wrappers

Related links

Thoughts & Questions

  • Although HTTP spec says headers are case-insensitive, http client libraries should not automatically downcase such values (especially for outgoing request) since there are applications require specific cases :frowning:
  • headers, form data, and query string should be a list not a map to preserve orders (both order of keys and order of values)
  • For performance, what about using NIF to parse headers? For example, puma (app server in Ruby) uses C for this: puma/ext/puma_http11 at v3.12.0 · puma/puma · GitHub - such parser may be shared across client/server.
  • How should HTTP libraries handle HTTP version upgrade?
  • Should HTTP libraries make pure functional (zero side effect) or leverage more global states (connection pools, keeping connection, etc.)?
    • For example, Tesla allows creating new client on the fly, so that it “builds” client without any configuration from “global” config; however as it may use HTTP client library (application) which maintains some state in it.

Showing Posts 21 to 12

kodepett

kodepett

I read your post on mint and I agree with you. I’m not sure of when they will fix this issue, I urgently need this to be fixed or try another library(any recommendation - processless if possible). Thanks.

chulkilee

chulkilee OP

As a library user, I expect a library does not touch what I give as much as possible… but as a library author I want to leverage details in specification to make things efficient and simpler.

See Downcase headers when inserting/fetching in HPACK by whatyouhide · Pull Request #172 · elixir-mint/mint · GitHub (I raised this matter there)

This can be a gotcha - e.g. if you build a signature with mixed cases but HTTP library sends a downcased header names… so integration testing is important! :slight_smile:

(I was fortunate to get away of bad HTTP server expecting specific case)

kodepett

kodepett

I ran into a strange issue today when connecting to an upstream server with Mojito - there’s a custom header which is being converted to lower case, however the upstream server expects the exact casing. Though I think this is a bad design, is there an option to force Mojito or Mint to maintain your case without converting them.

chulkilee

chulkilee OP

dimitarvp

dimitarvp

Oh, ergonomy and convenience. Thanks for clarifying.

kats

kats

No, I mean, the gun use tcp connection and some time we don’t need worries about it and we need just post/get something without knowing of socket or pid of connection. The shot is wrapper of httpc.
Eg: using of gun

{ok, ConnPid} = gun:open("example.org", 443),
StreamRef = gun:get(ConnPid, "/organizations/ninenines").

Eg: using of shot:

shot:get("http://example.org/somedata").
dimitarvp

dimitarvp

Not sure I understand. You mean you don’t want the HTTP Keep-Alive option used when calling a REST API?

kats

kats

Sure, I know the gun library, but gun use tcp connection, sometime we don’t need to keep connection with some services and just need to call some REST API - what was implemented inside of the shot library

dimitarvp

dimitarvp

I don’t mean to degrade, just curious if you compared your library to the Gun Erlang HTTP client?

kats

kats

Some time ago I started implement small client library use httpc. This library definitely don’t cover all needs, but I working on it. Recently was added the ability to pass the headers and body of the request as an argument. In any case, this library can be helpful shot - is a small HTTP client library for Erlang.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

Other Trending Topics Top

CodeSync
Kafka-Backed Elixir at Scale - Anton Borisov, Piotr Rybarczyk | ElixirConf EU 2026 https://www.youtube.com/watch?v=wNh4OFVXhRo Comment...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews