Versatile HTTP mocking made easy in Go that works with any net/http based stdlib implementation. 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. Ability to filter/map HTTP requests for accurate mock matching. Supports map and filters to handle mocks easily. Wide compatible HTTP interceptor using http.RoundTripper interface. Works with any net/http compatible client, such as gentleman. Network timeout/cancelation delay simulation. Extensible and hackable API. Dependency free.

Features

  • Extensible and pluggable HTTP matching rules
  • Designed for both testing and runtime scenarios
  • Supports persistent and volatile TTL-limited mocks
  • Built-in helpers for easy JSON/XML mocking
  • Wide compatible HTTP interceptor
  • Network timeout/cancelation delay simulation

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow gock

gock Web Site

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of gock!

Additional Project Details

Programming Language

Go

Related Categories

Go Software Development Software, Go Software Testing Tool

Registered

2022-03-22