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
210
Mint - Disrupting HTTP clients
Andrea Leopardi
August 29, 2019
Tweet
Share
More Decks by Andrea Leopardi
See All by Andrea Leopardi
The World is a Network (and We Are Just Nodes)
whatyouhide
0
160
BEAM: The Perfect Fit for Networks
whatyouhide
1
150
Update from the Elixir team - 2022
whatyouhide
0
350
Testing Asynchronous OTP
whatyouhide
0
470
Elixir Sightseeing Tour
whatyouhide
0
370
BEAM Architecture Handbook
whatyouhide
7
2.7k
The Evolution of a Language
whatyouhide
0
120
Elixir - functional, concurrent, distributed programming for the rest of us
whatyouhide
2
300
Papers we love: Elixir edition
whatyouhide
5
1k
Other Decks in Programming
See All in Programming
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
みんなでプロポーザルを書いてみた
yuriko1211
0
280
Arm移行タイムアタック
qnighy
0
330
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
CSC509 Lecture 09
javiergs
PRO
0
140
受け取る人から提供する人になるということ
little_rubyist
0
250
CSC509 Lecture 12
javiergs
PRO
0
160
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Code Review Best Practice
trishagee
64
17k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
A better future with KSS
kneath
238
17k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Ruby is Unlike a Banana
tanoku
97
11k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Designing for Performance
lara
604
68k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
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