gock
HTTP traffic mocking and testing made easy in Go
...Heavily inspired by nock. There is also its Python port, pook. Simple, expressive, fluent API. Semantic API DSL for declarative HTTP mock declarations. Built-in helpers for easy JSON/XML mocking. Supports persistent and volatile TTL-limited mocks. Full regular expressions capable HTTP request mock matching. Designed for both testing and runtime scenarios. Match request by method, URL params, headers and bodies. Extensible and pluggable HTTP matching rules. Ability to switch between mock and real networking modes. ...