Practice the Go snippets that appear in handlers and service layers: request decoding, response encoding, service calls, repository access, and status decisions.
What The HTTP Topic Trains
This topic is useful when your work often sits between transport and business logic. The code patterns here repeat structured function signatures, JSON helpers, context-aware calls, and readable branching around HTTP outcomes.
Continue from the next unfinished HTTP-focused Go exercise when progress exists, or start from the first relevant topic exercise when you are new to this page.
HTTP handlers repeat a distinctive mix of parameters, status codes, quotes, parentheses, tabs, and short response branches that can become much faster with deliberate practice.
The exercises in this topic keep that surface area narrow enough to repeat, while still looking like realistic service code instead of isolated syntax drills.
Service and repository flow
Many backend typing sessions involve moving from request parsing into service calls and then back into response formatting or error handling.
This section covers that movement directly, which makes it useful for developers who spend a lot of time in API and internal service code.
HTTP and service lessons
These lessons are pulled from the Go HTTP & Services section in the main course registry.
HTTP Handlers
Practice handler structure with request context and status handling.
Exercises: 1
Request Decoding
Practice decoding JSON input and validating the request body.
Exercises: 1
Response Encoding
Practice headers and json.NewEncoder response paths.
Exercises: 1
Service Calls
Practice handler-to-service calls with shared context and errors.
Exercises: 1
Repository Calls
Practice service-to-repository calls and wrapped failures.
Exercises: 1
Status Handling
Practice mapping validation and not-found branches to HTTP status codes.
Exercises: 1
Active HTTP exercises
Each exercise below opens the normal Go trainer with an HTTP or service-related snippet preselected.