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
2
220
The World is a Network (and We Are Just Nodes)
whatyouhide
1
210
BEAM: The Perfect Fit for Networks
whatyouhide
1
190
Update from the Elixir team - 2022
whatyouhide
0
400
Testing Asynchronous OTP
whatyouhide
1
510
Elixir Sightseeing Tour
whatyouhide
0
420
BEAM Architecture Handbook
whatyouhide
7
2.8k
The Evolution of a Language
whatyouhide
0
150
Elixir - functional, concurrent, distributed programming for the rest of us
whatyouhide
2
320
Other Decks in Programming
See All in Programming
最速Green Tea 🍵 Garbage Collector
kuro_kurorrr
1
130
エンジニアが挑む、限界までの越境
nealle
1
330
リアーキテクチャの現場で向き合う 既存サービスの読み解きと設計判断
ymiyamu
0
130
The Nature of Complexity in John Ousterhout’s Philosophy of Software Design
philipschwarz
PRO
0
170
Rubyの!メソッドをちゃんと理解する
alstrocrack
1
320
JAWS DAYS 2025 re_Cheers: WEB
komakichi
0
120
バイラテラルアップサンプリング
fadis
3
560
Road to Ruby for A Linguistics Nerd
hayat01sh1da
PRO
0
320
読書シェア会 vol.4 『ダイナミックリチーミング 第2版』
kotaro666
0
110
Bedrock × Confluenceで簡単(?)社内RAG
iharuoru
1
130
「MCPを使ってる人」が より詳しくなるための解説
yamaguchidesu
0
220
プロフェッショナルとしての成長「問題の深掘り」が導く真のスキルアップ / issue-analysis-and-skill-up
minodriven
8
2k
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
Agile that works and the tools we love
rasmusluckow
329
21k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
A Tale of Four Properties
chriscoyier
159
23k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
179
53k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Practical Orchestrator
shlominoach
187
11k
Designing for humans not robots
tammielis
253
25k
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