Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mint - Disrupting HTTP clients
Search
Andrea Leopardi
August 29, 2019
Programming
0
240
Mint - Disrupting HTTP clients
Andrea Leopardi
August 29, 2019
Tweet
Share
More Decks by Andrea Leopardi
See All by Andrea Leopardi
gen_statem - OTP's Unsung Hero
whatyouhide
1
210
The World is a Network (and We Are Just Nodes)
whatyouhide
1
200
BEAM: The Perfect Fit for Networks
whatyouhide
1
190
Update from the Elixir team - 2022
whatyouhide
0
390
Testing Asynchronous OTP
whatyouhide
1
510
Elixir Sightseeing Tour
whatyouhide
0
410
BEAM Architecture Handbook
whatyouhide
7
2.8k
The Evolution of a Language
whatyouhide
0
140
Elixir - functional, concurrent, distributed programming for the rest of us
whatyouhide
2
320
Other Decks in Programming
See All in Programming
Module Boundaries and Architecture with Forensic Analysis @NxSummit Amsterdam 2025
manfredsteyer
PRO
0
100
Sharing features among Android applications: experience feedback
jbvincey
0
110
Make Parsers Compatible Using Automata Learning
makenowjust
2
5.2k
Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership
cyrilmottier
2
300
The Evolution of the CRuby Build System
kateinoigakukun
0
720
Lambda(Python)の リファクタリングが好きなんです
komakichi
3
210
新しいPHP拡張モジュールインストール方法「PHP Installer for Extensions (PIE)」を使ってみよう!
cocoeyes02
0
410
「”誤った使い方をすることが困難”な設計」で良いコードの基礎を固めよう / phpcon-odawara-2025
taniguhey
0
160
リアルタイムレイトレーシング + ニューラルレンダリング簡単紹介 / Real-Time Ray Tracing & Neural Rendering: A Quick Introduction (2025)
shocker_0x15
1
310
AHC045_解説
shun_pi
0
550
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
160
Compose Hot Reload is here, stop re-launching your apps! (Android Makers 2025)
zsmb
1
520
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
Code Reviewing Like a Champion
maltzj
522
40k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
23
2.6k
Into the Great Unknown - MozCon
thekraken
37
1.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
670
Being A Developer After 40
akosma
91
590k
Visualization
eitanlees
146
16k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Typedesign – Prime Four
hannesfritz
41
2.6k
Transcript
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
{:ok, conn} = Mint.HTTP.connect( :https, "example.com", 80 ) conn #=>
%Mint.HTTP1{...}
{:ok, conn, request_ref} = Mint.HTTP.request( conn, "GET", "/", [{"content-type", "text/html"}]
)
None
{:ok, conn, request_ref} = Mint.HTTP.request(...)
None
None
None
receive do message -> Mint.HTTP.stream(conn, message) end
case Mint.HTTP.stream(conn, message) do :unknown -> # ... {:ok, conn,
responses} -> # ... {:error, conn, reason, responses} -> # ... end
{:status, ref, 200} {:headers, ref, [...]} {:data, ref, "...chunk..."} {:done,
ref} {:error, ref, reason}
None
None
None
:inets.start() :ssl.start() :httpc.request( 'https://self-signed.badssl.com' ) #=> {:ok, {{'HTTP/1.1', 200, 'OK'}...}
:hackney.request( :get, "https://self-signed.badssl.com", _headers = [], _body = "", _opts
= [] ) #=> {:error, {:tls_alert, ...}}
:hackney.request( :get, "https://self-signed.badssl.com", _headers = [], _body = "", ssl_options:
[versions: [:"tlsv1.2"]] ) #=> {:ok, 200, ...}
Mint.HTTP.connect( :https, "https://self-signed.badssl.com", 443 ) #=> {:error, %Mint.TransportError{...}}
None
None
defp deps do [ # ..., {:mint, "~> 0.4"}, {:castore,
"~> 0.1"} ] end
None
None
proxy = { :http, "proxy.example.com", 80, _opts = [] }
Mint.HTTP.connect( :https, "httpbin.org", 443, proxy: proxy )
None
None
None
None
None
{ :push_promise, ref, promised_ref, promised_headers }
None
{:ok, conn, ref} = Mint.HTTP2.ping(conn) # ... response #=> {:pong,
^ref}
None
Mint.HTTP.connect(...) Mint.HTTP1.connect(...) Mint.HTTP2.connect(...)
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None