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
220
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
170
BEAM: The Perfect Fit for Networks
whatyouhide
1
150
Update from the Elixir team - 2022
whatyouhide
0
360
Testing Asynchronous OTP
whatyouhide
0
470
Elixir Sightseeing Tour
whatyouhide
0
380
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
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
690
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
310
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
210
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
3
1.1k
useSyncExternalStoreを使いまくる
ssssota
6
1k
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
Featured
See All Featured
Music & Morning Musume
bryan
46
6.2k
Code Reviewing Like a Champion
maltzj
520
39k
Scaling GitHub
holman
458
140k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Side Projects
sachag
452
42k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
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