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
HTTP
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Andrew Liu
March 28, 2012
Programming
1.5k
17
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
HTTP
2012 CCSP
Andrew Liu
March 28, 2012
More Decks by Andrew Liu
See All by Andrew Liu
Facebook Graph API
eggegg
7
680
Version Control System - Git
eggegg
4
700
Introduction to Ruby
eggegg
3
640
Defly
eggegg
0
380
Other Decks in Programming
See All in Programming
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
340
AIだと陥りがちなJakarta EE最新技術への移行時の落とし穴と解決策
tnagao7
0
110
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.1k
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
350
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
120
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
130
スマートグラスで並列バイブコーディング
hyshu
0
140
3Dシーンの圧縮
fadis
1
770
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
11
4.1k
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
230
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.6k
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Building AI with AI
inesmontani
PRO
1
1.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
370
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
180
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
580
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
470
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Transcript
HTTP Andrew Liu
Hypertext Transfer Protocol
Hypertext Transfer Protocol <a href=”https://www.facebook.com/mikechencom”>Prof. Mike</a>
URL - Uniform Resource Locator https://www.facebook.com/prof.mike.chen
URL - Uniform Resource Locator https://www.facebook.com/prof.mike.chen scheme name http https
spdy
URL - Uniform Resource Locator https://www.facebook.com/prof.mike.chen scheme name http https
spdy authority
URL - Uniform Resource Locator https://www.facebook.com/prof.mike.chen scheme name http https
spdy authority path
Mike
Mike Hi Mike, How are you?
Mike Hi Mike, How are you? #@!@#!#$#@$
Mike
Mike Hi Mike, How are you?
Mike Hi Mike, How are you? Fine
Mike Hi Mike, How are you? Fine english://mike/status
www.facebook.com https://www.facebook.com/prof.mike.chen
www.facebook.com GET /prof.mike.chen HTTP/1.1 https://www.facebook.com/prof.mike.chen
www.facebook.com GET /prof.mike.chen HTTP/1.1 <html>.... https://www.facebook.com/prof.mike.chen
Real case: request GET / HTTP/1.1 Host: www.facebook.com Connection: keep-alive
Cache-Control: max-age=0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.83 Safari/535.11 Accept: text/html,application/xhtml+xml,application/ xml;q=0.9,*/*;q=0.8 Accept-Encoding: gzip,deflate,sdch Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4 Accept-Charset: UTF-8,*;q=0.5 Cookie: ....
www.facebook.com GET / HTTP/1.1 <html>.... https://www.facebook.com/
www.facebook.com GET / HTTP/1.1 <html>.... https://www.facebook.com/ How does it know
I have logged in?
HTTP is Stateless Server doesn’t know what the user did
last time.
www.facebook.com
www.facebook.com Hi, I’m Mike.
www.facebook.com Hi, I’m Mike. Ok, you’re Mike.
www.facebook.com Hi, I’m Mike. Ok, you’re Mike. Everyone can be
Mike now!
www.facebook.com
www.facebook.com Hi, I’m Mike. My password is “lab430”.
www.facebook.com Hi, I’m Mike. My password is “lab430”. Ok, you’re
Mike. Code: a3ad31
www.facebook.com Hi, I’m Mike. My password is “lab430”. Ok, you’re
Mike. Code: a3ad31 My code is a3ad31.
www.facebook.com Hi, I’m Mike. My password is “lab430”. Ok, you’re
Mike. Code: a3ad31 My code is a3ad31. Ok, you’re Mike.
www.facebook.com Hi, I’m Mike. My password is “lab430”. Ok, you’re
Mike. Code: a3ad31 Browser must remember the code! My code is a3ad31. Ok, you’re Mike.
Cookie to Rescue
Cookie to Rescue Key - value pair storage
Cookie to Rescue Key - value pair storage Sent every
time in HTTP request header Cookie: km_dbg=0; heroku_session_v=1; ...
Real case: response HTTP/1.1 200 OK Cache-Control: private, no-cache, no-store,
must-revalidate Expires: Sat, 01 Jan 2000 00:00:00 GMT Pragma: no-cache X-Content-Type-Options: nosniff X-Frame-Options: DENY Set-Cookie: _e_1V7k_5=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly Set-Cookie: L=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly Set-Cookie: wd=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/; domain=.facebook.com; httponly Content-Encoding: gzip Content-Type: text/html; charset=utf-8 X-FB-Debug: XKkfgkQmkDwO4VsOafKYEhfDbYk9WN8ANLHRCrl/9eU= X-Cnection: close Transfer-Encoding: chunked Date: Tue, 27 Mar 2012 13:16:47 GMT
HTTP Status Code
HTTP Status Code 2XX Success 200 OK
HTTP Status Code 2XX Success 200 OK 3XX Redirection 301
Move Permanently 302 Found (a.k.a. Moved Temporarily) 304 Not Modified
HTTP Status Code 2XX Success 200 OK 3XX Redirection 301
Move Permanently 302 Found (a.k.a. Moved Temporarily) 304 Not Modified 4XX Client Error 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found
HTTP Status Code 2XX Success 200 OK 3XX Redirection 301
Move Permanently 302 Found (a.k.a. Moved Temporarily) 304 Not Modified 4XX Client Error 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 5XX Server Error 500 Internal Server Error
Advanced Topics
mikechen.com
mikechen.com http://mikechen.com/
mikechen.com GET / HTTP/1.1 http://mikechen.com/
mikechen.com GET / HTTP/1.1 <html>... http://mikechen.com/
mikechen.com GET / HTTP/1.1 <html>... http://mikechen.com/
mikechen.com
mikechen.com http://mikechen.com/
mikechen.com Modified? http://mikechen.com/
mikechen.com Modified? No! http://mikechen.com/
mikechen.com Modified? No! http://mikechen.com/
HTTP Request Header
HTTP Request Header Host Host: www.apple.com
HTTP Request Header Host User-Agent Host: www.apple.com User-Agent: Mozilla/5.0 (Windows;
U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
HTTP Request Header Host User-Agent Accept-Language Host: www.apple.com User-Agent: Mozilla/5.0
(Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept-Language: en-us,en;q=0.5
HTTP Request Header Host User-Agent Accept-Language Accept-Encoding Host: www.apple.com User-Agent:
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate
HTTP Request Header Host User-Agent Accept-Language Accept-Encoding If-Modified-Since Host: www.apple.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate If-Modified-Since: Sat, 28 Nov 2009 06:38:19 GMT
HTTP Request Header Host User-Agent Accept-Language Accept-Encoding If-Modified-Since Referer Host:
www.apple.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate If-Modified-Since: Sat, 28 Nov 2009 06:38:19 GMT Referer: www.google.com
HTTP Response Header
HTTP Response Header Cache-Control Cache-Control: max-age=3600, public
HTTP Response Header Cache-Control Content-Encoding Cache-Control: max-age=3600, public Content-Encoding: gzip
HTTP Response Header Cache-Control Content-Encoding Content-Type Cache-Control: max-age=3600, public Content-Encoding:
gzip Content-Type: text/html; charset=UTF-8
HTTP Response Header Cache-Control Content-Encoding Content-Type Content-Disposition Cache-Control: max-age=3600, public
Content-Encoding: gzip Content-Type: text/html; charset=UTF-8 Content-Disposition: attachment; filename=”ccsp.pdf”
HTTP Response Header Cache-Control Content-Encoding Content-Type Content-Disposition Content-Length Cache-Control: max-age=3600,
public Content-Encoding: gzip Content-Type: text/html; charset=UTF-8 Content-Disposition: attachment; filename=”ccsp.pdf” Content-Length: 79324
HTTP Response Header Cache-Control Content-Encoding Content-Type Content-Disposition Content-Length Location Cache-Control:
max-age=3600, public Content-Encoding: gzip Content-Type: text/html; charset=UTF-8 Content-Disposition: attachment; filename=”ccsp.pdf” Content-Length: 79324 Location: http://ntumobile.org
HTTP Verbs
HTTP Verbs GET GET /books read
HTTP Verbs GET POST GET /books read POST /books create
HTTP Verbs GET POST PUT GET /books read POST /books
create PUT /books/hunger-game update
HTTP Verbs GET POST PUT DELETE GET /books read POST
/books create PUT /books/hunger-game update DELETE /books/hunger-game delete
None
None
<form method=”get” action=”/search”> <input type=”text” name=”q”> </form> or
<form method=”get” action=”/search”> <input type=”text” name=”q”> </form> or GET /search?q=mike+chen
HTTP/1.1 Host: www.google.com.tw User-Agent: Mozilla/4.0
{ :q => “mike chen” } <form method=”get” action=”/search”> <input
type=”text” name=”q”> </form> or GET /search?q=mike+chen HTTP/1.1 Host: www.google.com.tw User-Agent: Mozilla/4.0
None
<form method=”post” action=”/login”> <input type=”text” name=”user”> <input type=”password” name=”password”> <input
type=”submit” value=”Submit”> </form>
<form method=”post” action=”/login”> <input type=”text” name=”user”> <input type=”password” name=”password”> <input
type=”submit” value=”Submit”> </form> POST /login HTTP/1.1 Host: ccsp2012.org User-Agent: Mozilla/4.0 Content-Length: 25 Content-Type: application/x-www-form-urlencoded user=mike&password=lab430
END