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
280
Mint - Disrupting HTTP clients
Andrea Leopardi
August 29, 2019
Tweet
Share
More Decks by Andrea Leopardi
See All by Andrea Leopardi
The Umbrella and the Range
whatyouhide
0
30
gen_statem - OTP's Unsung Hero
whatyouhide
2
290
The World is a Network (and We Are Just Nodes)
whatyouhide
1
240
BEAM: The Perfect Fit for Networks
whatyouhide
1
230
Update from the Elixir team - 2022
whatyouhide
0
440
Testing Asynchronous OTP
whatyouhide
1
540
Elixir Sightseeing Tour
whatyouhide
0
460
BEAM Architecture Handbook
whatyouhide
7
2.9k
The Evolution of a Language
whatyouhide
0
180
Other Decks in Programming
See All in Programming
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
330
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.5k
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
250
Grafana:建立系統全知視角的捷徑
blueswen
0
280
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
190
ゆくKotlin くるRust
exoego
1
200
PC-6001でPSG曲を鳴らすまでを全部NetBSD上の Makefile に押し込んでみた / osc2025hiroshima
tsutsui
0
210
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
180
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
320
AgentCoreとHuman in the Loop
har1101
4
150
CSC307 Lecture 04
javiergs
PRO
0
630
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
300
Featured
See All Featured
Unsuck your backbone
ammeep
671
58k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
65
HDC tutorial
michielstock
1
320
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.1k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
A Modern Web Designer's Workflow
chriscoyier
698
190k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
110
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.9k
My Coaching Mixtape
mlcsv
0
23
The Invisible Side of Design
smashingmag
302
51k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.2k
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