Phase 7Days 31-35

HTTP APIs with the Standard Library

net/http, middleware, JSON contracts, validation, shutdown, and observability

Phase Goal

Build production-shaped APIs using net/http before adopting frameworks.

Progress

Day 31: HTTP Mental Model & net/http

Day 32: JSON APIs, Validation & Errors

Day 33: Middleware, Logging & Request IDs

Day 34: Clients, Context & Graceful Shutdown

Day 35: Mini Project — Community Tool Library API

Capstone
Community Tool Library API

Build an in-memory standard-library API for librarians to register tools, issue and return loans, quarantine damaged equipment, and expose a privacy-safe public catalog.

  • net/http only with explicit server limits
  • Illegal loan and maintenance transitions rejected
  • httptest coverage, request tracing, and graceful shutdown

Phase Complete!

After this phase, you'll be able to:

  • Request-response lifecycle and HTTP semantics
  • ServeMux patterns and method-aware routes
  • Handlers, ResponseWriter commit behavior, and headers
  • Server timeouts and explicit configuration
  • Decode limits and unknown-field rejection
  • Transport/domain separation and validation
  • Consistent problem response envelopes
  • Status-code decisions and idempotent semantics

You can apply Phase 7 skills in a finished, explainable Go project.