HTTP stand for Hyper Text Transfer Protocol. A protocol used for web browsing. Specifies messages exchanged.

  • HTTP/1.1 specified in RFC 2616
  • Request methods : GET, POST, PUT, DELETE Messages are text-based, in lines (Unix: CR+LF). Stateless client-side design
  • Quickly became a problem, hence cookies.

NB : HTTP is entirely separate from HTML !!!

  • HTTP headers are not HTML <head>.
  • HTML is a text format for web content.

HTTP Communication

HTTP is a client-server protocol.

  • Client initiates TCP connection (usually port 80).
  • Client sends HTTP request over connection.
  • Server responds
    • May close connection (HTTP 1.0 default).
    • Or keep it persistent for a short time.
  • Server never initiates a connection.
    • Except a newer HTML5 Websockets.
    • Websockets allow low-latency interactivity.
    • Upgrade : WebSocket handshake & switch to ws
    • Expect to see rise in use and security issues.