AI Hints
Home›System Design Tutorial›How the Network Works
System Design · Lesson 14 of 120

HTTP and HTTPS

How browsers talk.

⏱ 2 min read▶ Video at 15:33🎓 Free
Watch this lesson in the System Design courseWatch on YouTube ↗Full System Design course

Once your browser knows the address, it talks to the server in HTTP. Every request has a method, a path, some headers, and sometimes a body. Every response has a status code.

HTTP and HTTPS
From the video: HTTP and HTTPS
  • Method and path
  • Headers and body
  • A status code back

Status codes

Status codes tell you what happened. The two hundreds mean success. Two hundred is OK, and two oh one means something was created. The three hundreds mean go somewhere else. The four hundreds mean the client made a mistake, like four oh four, not found. And the five hundreds mean the server failed.

CodeMeaning
200 OKit worked
201 Creatednew thing made
301 / 302go somewhere else
404 Not Foundclient asked for nothing
500 / 503server failed

HTTP vs HTTPS

Plain HTTP sends everything as readable text, so anyone on the network can read or change it. HTTPS wraps the same messages in TLS encryption. It also proves the server is really who it says it is, using a certificate. Today, every public site should use HTTPS.

HTTP

  • Readable by anyoneCan be changedNever for real users

HTTPS

  • Encrypted with TLSServer proves identityUse it everywhere

Summary

HTTP carries requests and responses, and status codes say what happened. HTTPS adds encryption and identity. Next, the two ways data travels underneath. TCP and UDP.

Key takeaways
  • Method, path, headers, body
  • 2xx ok, 4xx client, 5xx server
  • Always HTTPS
Next up: TCP vs UDP — reliable or fast