Hypertext Transport Protocol (HTTP) : Mendel Rosenblum
Hypertext Transport Protocol (HTTP) : Mendel Rosenblum
Protocol (HTTP)
Mendel Rosenblum
HTTP
LAN
Internet
2
Universal Resource Locator (URL)
http://www.example.com:80/index.html
● To display page browser fetches the file index.html from a web server
Same as www.example.com (Defaults: port 80, file index.html, http protocol)
● HTTP (HyperText Transport Protocol)
● HTTP - Simple request-response protocol layered on TCP/IP
HTTP/1.1 200 OK
Date: Thu, 24 Jul 2008 17:36:27 GMT
Header Server: Apache-Coyote/1.1
Content-Type: text/html;charset=UTF-8
Content-Length: 1846
blank line
<?xml ... >
<!DOCTYPE html ... >
Body <html ... >
...
CS142 Lecture Notes - HTTP
</html>
Common HTTP Response Status Codes
200 OK Success
307 Temporary Redirect Redirection - Browser retries using Location header
404 Not Found Famous one
503 Service Unavailable Something crashed on the server
500 Internal Server Error Something is messed up on the server
501 Not Implemented Coming
400 Bad Request Use if web app sends bogus request
401 Unauthorized Use if user isn't logged in
403 Forbidden Use if even logging in wouldn't help
550 Permission denied Not allow to perform request
Uses HTTP to fetch myJS.js and runs it! Scary but useful.