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
270
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
19
gen_statem - OTP's Unsung Hero
whatyouhide
2
270
The World is a Network (and We Are Just Nodes)
whatyouhide
1
230
BEAM: The Perfect Fit for Networks
whatyouhide
1
210
Update from the Elixir team - 2022
whatyouhide
0
420
Testing Asynchronous OTP
whatyouhide
1
530
Elixir Sightseeing Tour
whatyouhide
0
440
BEAM Architecture Handbook
whatyouhide
7
2.9k
The Evolution of a Language
whatyouhide
0
170
Other Decks in Programming
See All in Programming
Kotlin + Power-Assert 言語組み込みならではのAssertion Library採用と運用ベストプラクティス by Kazuki Matsuda/Gen-AX
kazukima
0
110
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
140
Honoを技術選定したAI要件定義プラットフォームAcsimでの意思決定
codenote
0
130
Claude Code on the Web を超える!? Codex Cloud の実践テク5選
sunagaku
0
470
Phronetic Team with AI - Agile Japan 2025 closing
hiranabe
1
250
高単価案件で働くための心構え
nullnull
0
100
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
3
5.9k
Functional Calisthenics in Kotlin: Kotlinで「関数型エクササイズ」を実践しよう
lagenorhynque
0
110
CSC509 Lecture 09
javiergs
PRO
0
290
CSC509 Lecture 13
javiergs
PRO
0
240
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
360
r2-image-worker
yusukebe
1
160
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
GraphQLとの向き合い方2022年版
quramy
49
14k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
117
20k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Code Reviewing Like a Champion
maltzj
527
40k
A designer walks into a library…
pauljervisheath
210
24k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
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