Exercises XP — HTTP & Forms

Simple demo with GET / POST forms and a JSON example.

⭐ Exercise 1: HTML Form (GET)

When I click Send, the data goes into the URL (query string).

Where does GET data appear?

  • 🟢 In the URL after the ? (example: ?name=Mario&message=Hello).
  • 🟢 I also parse the URL and show a tiny JSON below:
{}

⭐ Exercise 2: HTML Form #2 (POST)

POST does not show data in the URL. I need DevTools → Network to see it.

Where does POST data appear?

  • 🟣 Not in the URL (clean URL).
  • 🟣 In the request body. Open DevTools → Network, click the request, then see Payload / Form Data.
  • 🟣 Tip: run a tiny local server so the request actually shows in the Network tab:
    python -m http.server 8000
    then open http://localhost:8000/

⭐ Exercise 3: JSON Mario

Convert a JS object to JSON (stringify) and pretty print it.

{}