Skip to content
  • HTTP & the Web · Computer Networks

HTTP & the Web

LearnViaNotes @learnvianotes· 1 min read

The protocol underneath every webpage you've ever loaded.

Stateless by design

HTTP is a stateless protocol — by default, each request is independent and the server doesn't remember anything about previous requests from the same client. This is exactly why cookies exist: to layer state on top of a fundamentally stateless protocol.

HTTP Methods

MethodPurpose
GETRetrieve a resource, no side effects
POSTCreate a new resource / submit data
PUTReplace a resource entirely
PATCHPartially update a resource
DELETERemove a resource

Status codes

RangeMeaning
1xxInformational
2xxSuccess
3xxRedirection
4xxClient mistake (bad request, unauthorized, not found)
5xxServer error

Request & Response headers

Both requests and responses carry metadata in headers — e.g. content type, content length, and Keep-Alive settings, which define a timeout for how long a TCP connection should stay open for reuse before being closed, avoiding the overhead of reconnecting for every single request.

Cookies

  • The first time you visit a site, the server sets the cookie in your browser.

  • On every subsequent visit, the browser automatically sends that cookie back, letting the server recognize you.

  • Cookies have an expiration date, after which they're discarded.

  • Third-party cookies — cookies set for domains other than the one you're actually visiting (commonly used for cross-site tracking/ads).

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report