JMU
The Hypertext Transfer Protocol
An Introduction


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Hypertext Transfer Protocol
The Process
The Process (cont.)
Uniform Resource Identifiers
HTTP 1.0 GET Requests

GET URI HTTP/1.0 CRLF
Name1: Value1 CRLF
Name2: Value2 CRLF
.
.
.
NameN: ValueN CRLF
CRLF

HTTP 1.0 POST Requests

POST URI HTTP/1.0 CRLF
Content-type: Type CRLF
Content-length: Bytes CRLF
CRLF
Data

Important Differences between GET/HEAD and POST Requests
Important Differences between GET/HEAD and POST Requests (cont.)
HTTP 1.0 Responses

HTTP/1.0 ResponseCode ResponseText CRLF
Name1: Value1 CRLF
Name2: Value2 CRLF
.
.
.
NameN: ValueN CRLF
CRLF
Data

HTTP Response Codes
http://www.smbc-comics.com/comics/20111031.gif
(Courtesy of Saturday Morning Breakfest Cereal)
Try It Yourself!
Nerd Humor
API
http://imgs.xkcd.com/comics/api.png
(Courtesy of xkcd)
What Does a WWW Browser Do?

Let's figure it out

Cookies
Cookies (cont.)
Third-Party Cookies