Home › HTML Masterclass › Accessibility and Tools
Module 10: NetworkingInterview Special

37. HTTP Methods and Status Codes (HTTP Methods & Codes)

The meaning of GET, POST, 200, 301, 403, 404, 500

Real-life analogy

Think of a restaurant: GET is looking at the menu card, POST is ordering food, and 404 is the waiter saying 'Sorry, this dish is finished!'

Explanation

1. Main HTTP methods:

  • GET: Retrieving data from the server.
  • POST: Sending new data to the server.

2. Main status codes:

200 OK: Successful
301 Moved: Page permanently moved
403 Forbidden: No permission
404 Not Found: Page not found
500 Server Error: Server fault

Golden rules

  • Always use POST in a login form.

Common mistake

Getting confused between 404 and 500 errors. 404 is the user's mistake, 500 is the server developer's mistake.

Example code

<!DOCTYPE html>
<html>
<body style="font-family: sans-serif; padding: 20px; text-align: center;">
  <div style="padding: 20px; border: 2px solid #ef4444; border-radius: 8px; background: #fef2f2; max-width: 280px; margin: auto;">
    <h1 style="color: #dc2626; font-size: 32px; margin: 0;">404</h1>
    <h4 style="color: #991b1b; margin: 4px 0;">Page Not Found</h4>
    <p style="font-size: 11px; color: #7f1d1d;">The requested page does not exist on the server.</p>
  </div>
</body>
</html>

Run & edit this in the live editor

Quick quiz

When a file or page is not found on a website, which error code does the browser show?

  1. 200
  2. 301
  3. 404
  4. 500
Show answer

Answer: 404

404 Not Found means that the requested page does not exist on the server.

← All 38 lessons