RANIARANIA Academy

Building Web Services & REST APIs

Build a production-shaped HTTP API in Go using only the standard library plus a light router. You will serve routes with net/http and ServeMux, encode and decode JSON, add middleware and request context, implement a full REST CRUD resource, and shut the server down gracefully.

Watch the free preview

The net/http server and ServeMux — free to watch, no account needed.

Go (Golang) ADVANCED · 150 min · Certificate on completion · 3 CPD points

What you'll learn

  • Build an HTTP API in Go using net/http, handlers and ServeMux
  • Encode and decode JSON safely for request and response bodies
  • Add cross-cutting middleware and pass values through request context
  • Implement a full REST CRUD resource with method-based routing
  • Introduce the chi router and shut a server down gracefully

Syllabus

Serving HTTP with net/http
The net/http server and ServeMuxFree preview15 min
Reading requests and writing responses15 min
JSON and a REST Resource
Encoding and decoding JSON15 min
A REST CRUD resource with method routing15 min
Middleware and Context
Middleware in Go15 min
Request context and cancellation15 min
Production-Ready APIs
Routing with the chi library15 min
Graceful shutdown and server configuration15 min
Lab — 10 Exercises & Solutions
Exercises 1–515 min
Exercises 6–1015 min