HTTP

Junghoo Cho

cho@cs.ucla.edu

Web Interaction Example

How Does It Work?

Internet

Core Internet Standards

Core Internet Standards

Core Internet Standards

HTTP

HTTP: Request & Response

HTTP: Stateless Protocol

HTTP Example

HTTP Message

HTTP Request Example

GET /apps/echo.py HTTP/1.1
Host: oak.cs.ucla.edu
Connection: keep-alive
Cache-Control: max-age=0
Dnt: 1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9,ko;q=0.8
Cookie: _xsrf=2|11b01aa1

HTTP Response Example

HTTP/1.1 200 OK
Date: Wed, 04 Apr 2019 03:20:33 GMT
Cache-Control: max-age=0, no-cache, s-maxage=10
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 997
Content-Type: text/html; charset=UTF-8
Server: Apache/2.4.29 (Ubuntu)
Vary: Accept-Encoding

<html>
<head><title>Example page</title></head>
...

HTTP Request Line

HTTP Methods (1)

HTTP Methods (2)

HTTP Header

GET /apps/echo.py HTTP/1.1
Host: oak.cs.ucla.edu
Connection: keep-alive
Cache-Control: max-age=0
Dnt: 1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9,ko;q=0.8
Cookie: _xsrf=2|11b01aa1

HTTP Response

HTTP/1.1 200 OK
Date: Wed, 04 Apr 2019 03:20:33 GMT
Cache-Control: max-age=0, no-cache, s-maxage=10
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 997
Content-Type: text/html; charset=UTF-8
Server: Apache/2.4.29 (Ubuntu)
Vary: Accept-Encoding

<html>
<head><title>Example page</title></head>
...

HTTP Response

Status Code

HTTP Response Header

HTTP/1.1 200 OK
Date: Wed, 04 Apr 2019 03:20:33 GMT
Cache-Control: max-age=0, no-cache
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 997
Content-Type: text/html; charset=UTF-8
Server: Apache/2.4.29 (Ubuntu)
Vary: Accept-Encoding

<html>
<head><title>Example page</title></head>
...

Questions?

HTTP/2: Background

HTTP/2

HTTP/2 New Features (1)

HTTP/2 New Features (2)

References