← Back to all lessons

03 / Web / 35 min READ + PRACTICE

HTTP requests and safe test apps.

Read methods, headers, bodies, redirects and response codes using an application you own.

Practice boundaryUse your own devices, your isolated practice VM or 127.0.0.1. Get explicit authorization for any other system.

Trace a request end to end

A URL identifies scheme, host, port and path. A request has a method, headers and optionally a body; the response carries a status, headers and data. Use browser developer tools to compare a page request with its CSS and API requests.

Generate your own endpoint

Run python3 -m http.server 8000 --bind 127.0.0.1 from a folder with an index.html file. Use curl to inspect status and headers, then change the path to a missing file and compare the 404. The default file server is for local exercises, not production deployment.

LAB TERMINAL / EXAMPLE
python3 -m http.server 8000 --bind 127.0.0.1
curl -i http://127.0.0.1:8000/
curl -i http://127.0.0.1:8000/not-found

Separate observation from an exploit

Use test inputs in your own app to see how validation behaves. Encode user-provided output, limit request bodies, and do not assume client-side validation is enough. Capture the expected and actual response rather than making a claim without evidence.

HANDS-ON EXERCISE

Try it in your lab

Create an index.html, serve it locally, and record the status and Content-Type for the page and a missing path.

CHECKPOINT

Make sure it clicks

Why can a browser-side required field not replace server-side input validation?

TRY WITH OPENCODE

A prompt you can adapt

Build a tiny localhost-only Python HTTP example that validates a short form input and returns clear 400 responses; include tests.
How to set up OpenCode ↗
Your progress stays in this browser only.