github.com/dankinder/httpmock (go): Package httpmock builds on httptest, providing easier API mocking.  Essentially all httpmock does is implement a similar interface to httptest, but using a Handler that receives the HTTP method, path, and body rather than a request object. This makes it very easy to use a featureful mock as the handler, e.g. github.com/stretchr/testify/mock  Examples  This example uses MockHandler, a Handler that is a github.com/stretchr/testify/mock object.  If instead you wish to match against headers as well, a slightly different httpmock object can be used (please note the change in function name to be matched against):  Httpmock also provides helpers for checking calls using json objects, like so:
Keywords: golang|http|httptest|mock