Skip to content
Ameen Abozaid
BEG-052

Web fundamentals

  • 7 Lessons
  • 71 min of reading
  • 2 h practice (estimate)
On this page 8 topics

Overview

Topics

  • HTTP methods
  • status codes
  • headers
  • JSON
  • URLs
  • query parameters
  • request body

Learn first

71 min of reading · 2 h of practice (estimate)

Learning outcomes

  1. Describe the structure of an HTTP request and response (method, URL, headers, body, status).
  2. Choose the right HTTP method and interpret status code classes (2xx, 3xx, 4xx, 5xx).
  3. Read and write JSON, and map it mentally to Java objects.
  4. Identify path, query parameters, and fragments in a URL.

Lessons

  1. 01Anatomy of an HTTP request11 min read
  2. 02Methods: GET, POST, PUT, PATCH, DELETE10 min read
  3. 03Status codes10 min read
  4. 04Headers10 min read
  5. 05JSON10 min read
  6. 06URLs and query parameters10 min read
  7. 07Demo: reading real HTTP traffic in the browser10 min read

Lab and exercises

Lab

BEG-052-LAB1 · Read real traffic

Outcomes: 1–4 · Time: ~2 h Capture five requests from a real site in the browser's Network tab and annotate method, URL parts, key headers, status, and body type. Acceptance: all parts correctly labeled.

Exercises (assessment: quiz)

IDOutcomeTask
BEG-052-EX011Label the parts of a given raw request and response.
BEG-052-EX022Pick a method for: list books, add a book, replace a book, change only a title, delete a book.
BEG-052-EX032Name the status class and likely code for: created, not found, not logged in, server crash.
BEG-052-EX043Write JSON for a member with a name, an age, and a list of two phone numbers.
BEG-052-EX053Draw the Java class that matches your JSON from EX04.
BEG-052-EX064Split https://api.example.com/books?author=herbert&page=2#top into its parts.
BEG-052-EX072Explain why a "delete" link implemented as GET /deleteBook?id=7 is a bad idea.
Show solutions
  • EX01 Request: method, URL/path, headers, optional body. Response: status line, headers, body.
  • EX02 GET, POST, PUT, PATCH, DELETE.
  • EX03 2xx 201; 4xx 404; 4xx 401; 5xx 500.
  • EX04 {"name":"Ana","age":30,"phones":["555-0101","555-0102"]}.
  • EX05 class Member { String name; int age; List<String> phones; }.
  • EX06 Scheme https, host api.example.com, path /books, query author=herbert&page=2, fragment top.
  • EX07 A GET must not change data; browsers, crawlers, and caches may repeat it. Use DELETE /books/7.

Quiz

Outcomes: O1 request and response anatomy · O2 methods and status codes · O3 JSON · O4 URLs.

A self-check for you: nothing is graded, saved or sent anywhere. Choose an answer, then check it. You can try again as often as you like.

  1. 1A response always includes:O1
  2. 2HTTP being stateless means:O1
  3. 3Which method should only read data?O2
  4. 4Create a new resource with:O2
  5. 5A 404 means:O2
  6. 6Status class for server errors:O2
  7. 7The header that tells the body format:O2
  8. 8A JSON array maps best to a Java:O3
  9. 9Valid JSON key quoting:O3
  10. 10In /books?page=2 the page=2 is the:O4

Practical part

The assessment is this quiz; the lab (BEG-052-LAB1) checks five annotated requests. Pass: at least 8 of 10 quiz questions and all lab parts correctly labeled.

Common mistakes

GET with side effects; treating every error as 500.

Assessment

Quiz.

Career relevance

HTTP in depth (JNR-017).

Type to search levels, phases, modules and lessons.