Chapter 6

Debugging HTTP Services in Go

Debug HTTP/1.1 and HTTP/2 services using GODEBUG, httputil, and httptest

✓ Use GODEBUG=http2debug=2 ✓ Dump requests/responses ✓ Use httptest for testing
1
HTTP/2 Debugging
Use GODEBUG=http2debug=2 to debug HTTP/2 connections - how a Google Cloud Storage bug was found
orijtech.github.io/talks/2021/12/02/amex/go_machine_guides.htm#19 +25 XP intermediate
2
Dumping HTTP Requests & Responses
Use httputil.DumpRequest and DumpResponse to examine HTTP traffic in wire format
medium.com/orijtech-developers/taming-net-http-b946edfda562 +20 XP intermediate
3
Test Servers with httptest
Use httptest.NewServer for testing HTTP handlers without opening real ports
medium.com/orijtech-developers/taming-net-http-b946edfda562 +20 XP intermediate
4
Custom HTTP Transport
Create custom http.RoundTripper to mock, intercept, or modify HTTP traffic
medium.com/orijtech-developers/taming-net-http-b946edfda562 +25 XP advanced