HTTP Protocol
- NOTE: Some of the notes below are from the TCP/IP Guide v.3 e-book and from Matt Daley's notes from Internet Technology course, Fall 08.
- Request and response Protocol
- HTTP Client sends request, HTTP server sends response
- Client requests home page (HTML file), then subsequent requests for each of the related files for that document.
- In HTTP 1.1, can receive multiple files (web HTML document, image1, image2) over one session. Called persistent sessions
- HTTP Clients can send multiple requests up front to HTTP server because of persistent sessions.
- Web Pages made up of several pieces, objects:
- Base HTML Documents
- Images
- CSS (Style Sheets)
- Plugins
- All messages are request, response
- Request message:
GET / HTTP/1.1
Host: www.marlboro.edu
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OSX [...])
Accept: text/xml,application/xml [...]
Accept-language: en-us,en;q=0.5
Accept-Encoding: gzip [...]
Accept-Charset: ISO-8859-1 [...]
Keep-Alive: 300
Connection: keep-alive
HTTP/1.x 200 OK
Date: Mon, 03 Sep 2007 19:10:35 GMT
Server: Apache
X-Powered-By: PHP/5.12
Set-Cookie: front_page[0]=0;expires=[...]
Set-Cookie: front_page[1]=0;expires=[...]
Set-Cookie: front_page[2]=1;expires=[...]
Content-Length: 5129
Keep-Alive: Timeout=15; max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
[**Begin Object: html or image, etc....]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML [...]">
[**End Object]
- Accepted HTTP Methods - Requests
- GET-Requests ITEM
- Conditional GET - Uses If-Match or If-Modified-Since headers to get or not get files based on responses.
- HEAD-Just get headers
- POST-Sends info to server
- OPTIONS-Client uploads file to URI on Server
- DELETE-Asks server to delete something
- TRACE-Client requests copy of message it sent to server
- Server Responses
- 200 OK-Request Successful
- 301 Moved Permanently-Usually just redirected
- 400 Bad Request
- 401 Authorization Required
- 404 Not Found
- 500 Internal Server Error