Skip to content

Glossary: Go Beyond the Basics

httptest

Also written: net/http/httptest, httptest.NewRequest, httptest.NewRecorder

A package for testing handlers without a network. `NewRequest` makes a fake request and `NewRecorder` captures the status code and body.

Where the book teaches it

Related terms

handler (HTTP)strings.NewReader