httpmock
HTTP mocking library for Rust
0.8.3
28M downloads/mo
#1762 most downloaded on crates.io
httpmock/httpmock
What this package is like to depend on
Last release 6 months ago
04 Feb 2026
Release timing varies
gaps range from 1 weeks to 13 months
Most releases are documented
notes for 24 of 37 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
43 releases · first in 2019
4 releases in the last 12 months
see the full history below
Release timeline
43 releases · Sep 2019 to Feb 2026Releases
latest 43-
0.8.304 Feb 2026Release notes
Open source →Minimum supported Rust version has been raised to 1.88.
The following PRs have been merged:
- #186: "Remove unused code and trait methods for cleanup" (thanks @FalkWoldmann)
- #191: "upgrade Rust" (thanks @sebdotv)
- #201: "Replace unmaintained rustls-pemfile with rustls-pki-types" (thanks @aleics)
- #205: "Fix is_false custom matcher" (thanks @dfaust)
- #206: "fix: remove unneeded 'Deserialize' trait bound" (thanks @danieleades and @FalkWoldmann)
- #211: "style: remove unneeded 'mut'" (thanks @danieleades)
All changes between since the last release:
v0.8.2...v0.8.3Release notes
Open source →Minimum supported Rust version has been raised to 1.88.
- #186: "Remove unused code and trait methods for cleanup" (thanks @FalkWoldmann)
- #191: "upgrade Rust" (thanks @sebdotv)
- #201: "Replace unmaintained rustls-pemfile with rustls-pki-types" (thanks @aleics)
- #205: "Fix is_false custom matcher" (thanks @dfaust)
- #206: "fix: remove unneeded 'Deserialize' trait bound" (thanks @danieleades and @FalkWoldmann)
- #211: "style: remove unneeded 'mut'" (thanks @danieleades)
-
0.8.217 Oct 2025Release notes
Open source →This release includes bug fixes, documentation enhancements and new features, such as dynamic responders.
The following pull requests have been merged:
-
0.8.106 Oct 2025Release notes
Open source →This release includes bug fixes and documentation enhancements.
The following pull requests have been merged:
- #179: "Use scheme of target url for forwarding"
Release notes
Open source →This release includes bug fixes and documentation enhancements.
The following pull requests have been merged:
- #179: "Use scheme of target url for forwarding"
-
0.8.025 Sep 2025Release notes
Open source →This release includes refactoring, dependency updates, and internal cleanups.
No breaking changes expected.The minimum required Rust version has been increased to 1.82.
The following pull requests have been merged:
- #172: "Update Rust edition to 2021" (thanks @FalkWoldmann)
- #169: "Proxy HTTPS fix"
- #167: "Replace log and env_logger with tracing and tracing-subscriber" (thanks @FalkWoldmann)
- #166: "Remove unused code" (thanks @FalkWoldmann)
- #163: "fix: issue 162, non localhost hosts match" (thanks @Thomblin)
- #160: "Replace custom read_file with std::fs::read_to_string" (thanks @FalkWoldmann)
- #158: "Improve async executor support"
- #156: "Bump async-object-pool to replace async-std"
- #153: "ci(deps): bump actions/checkout from 4 to 5"
- #152: "Fix missing standalone routes"
- #151: "Cleanup unused test functions"
- #147: "ci(deps): bump codecov/codecov-action from 2 to 5"
- #146: "cargo(deps): update thiserror requirement from 1 to 2"
- #145: "ci(deps): bump actions/checkout from 2 to 4"
- #144: "ci(deps): bump docker/build-push-action from 4 to 6
- #141: "cargo(deps): update path-tree requirement from >=0.8.0, <0.8.1 to >=0.8.0, <0.8.4"
- #140: "ci(deps): bump docker/login-action from 1 to 3"
- #139: "ci(deps): bump withastro/action from 2 to 4"
- #138: "Create dependabot.yml" (thanks @FalkWoldmann)
- #136: "Replace async_std with tokio" (thanks @FalkWoldmann)
Release notes
Open source →This release includes refactoring, dependency updates, and internal cleanups. No breaking changes expected.
The minimum required Rust version has been increased to 1.82.
The following pull requests have been merged:
- #172: "Update Rust edition to 2021" (thanks @FalkWoldmann)
- #169: "Proxy HTTPS fix"
- #167: "Replace log and env_logger with tracing and tracing-subscriber" (thanks @FalkWoldmann)
- #166: "Remove unused code" (thanks @FalkWoldmann)
- #163: "fix: issue 162, non localhost hosts match" (thanks @Thomblin)
- #160: "Replace custom read_file with std::fs::read_to_string" (thanks @FalkWoldmann)
- #158: "Improve async executor support"
- #156: "Bump async-object-pool to replace async-std"
- #153: "ci(deps): bump actions/checkout from 4 to 5"
- #152: "Fix missing standalone routes"
- #151: "Cleanup unused test functions"
- #147: "ci(deps): bump codecov/codecov-action from 2 to 5"
- #146: "cargo(deps): update thiserror requirement from 1 to 2"
- #145: "ci(deps): bump actions/checkout from 2 to 4"
- #144: "ci(deps): bump docker/build-push-action from 4 to 6
- #141: "cargo(deps): update path-tree requirement from >=0.8.0, <0.8.1 to >=0.8.0, <0.8.4"
- #140: "ci(deps): bump docker/login-action from 1 to 3"
- #139: "ci(deps): bump withastro/action from 2 to 4"
- #138: "Create dependabot.yml" (thanks @FalkWoldmann)
- #136: "Replace async_std with tokio" (thanks @FalkWoldmann)
-
0.8.0-alpha.101 Sep 2024 pre-releaseRelease notes
Open source →BREAKING CHANGES
- A new MockServer::reset method was added that resets a mock server. Thanks for providing the pull request for this feature, @dax.
- The default port for standalone server was changed from
5000to5050due to conflicts with system services on macOS. - Custom matcher functions are now closures rather than functions.
- When::json_body_partial was renamed to
json_body_includes. - When::x_www_form_urlencoded_tuple was renamed to
form_urlencoded_tuple. - When::x_www_form_urlencoded_key_exists was renamed to
form_urlencoded_key_exists. - Error message output has been changed for better readability (e.g., when calling
Mock::assert). - Custom matcher function
When::matcheshas been renamed toWhen::is_true.
Improvements
- Record and Playback mode was added
- Many new matchers functions have been added
- Proxy Mode was added
- Website docs have been created (see https://alexliesenfeld.github.io/httpmock/)
- HTTPS support added
- Internal implementation was entirely rewritten
Release notes
Open source →BREAKING CHANGES
- A new MockServer::reset method was added that resets a mock server. Thanks for providing the pull request for this feature, @dax.
- The default port for standalone server was changed from
5000to5050due to conflicts with system services on macOS. - Custom matcher functions are now closures rather than functions.
- When::json_body_partial was renamed to
json_body_includes. - When::x_www_form_urlencoded_tuple was renamed to
form_urlencoded_tuple. - When::x_www_form_urlencoded_key_exists was renamed to
form_urlencoded_key_exists. - Error message output has been changed for better readability (e.g., when calling
Mock::assert). - Custom matcher function
When::matcheshas been renamed toWhen::is_true.
Improvements
- Record and Playback mode was added
- Many new matchers functions have been added
- Proxy Mode was added
- Website docs have been created (see https://httpmock.rs)
- HTTPS support added
- Internal implementation was entirely rewritten
Improvements
- The algorithm to find the most similar request in case of mock assertion failures has been improved.
-
0.7.005 Jan 2024Release notes
Open source →-
BREAKING CHANGES:
- For connecting to remote
httpmockservers during tests using any of theconnectmethods like
MockServer::connect,
MockServer::connect_async,
MockServer::connect_from_env, or
MockServer::connect_from_env_async,
you must now activate theremotefeature. This feature is not enabled by default.
- For connecting to remote
-
Improvements:
- The dependency tree has been significantly slimmed down when the
remotefeature is not enabled. - If the new
remotefeature is not enabled,httpmockno longer has a dependency on a real HTTP client.
As a result, certain TLS issues previously reported by users
should no longer arise.
- The dependency tree has been significantly slimmed down when the
-
This release also updates all dependencies to the most recent version.
-
The minimum Rust version has been bumped to 1.70.
Release notes
Open source →-
BREAKING CHANGES:
- For connecting to remote
httpmockservers during tests using any of theconnectmethods like MockServer::connect, MockServer::connect_async, MockServer::connect_from_env, or MockServer::connect_from_env_async, you must now activate theremotefeature. This feature is not enabled by default.
- For connecting to remote
-
Improvements:
- The dependency tree has been significantly slimmed down when the
remotefeature is not enabled. - If the new
remotefeature is not enabled,httpmockno longer has a dependency on a real HTTP client. As a result, certain TLS issues previously reported by users should no longer arise.
- The dependency tree has been significantly slimmed down when the
-
This release also updates all dependencies to the most recent version.
-
The minimum Rust version has been bumped to 1.70.
-
-
0.7.0-rc.115 Oct 2023 pre-releaseRelease notes
Open source →-
BREAKING CHANGES:
- For connecting to remote
httpmockservers during tests using any of theconnectmethods like
MockServer::connect,
MockServer::connect_async,
MockServer::connect_from_env, or
MockServer::connect_from_env_async,
you must now activate theremotefeature. This feature is not enabled by default.
- For connecting to remote
-
Improvements:
- The dependency tree has been significantly slimmed down when the
remotefeature is not enabled. - If the new
remotefeature is not enabled,httpmockno longer has a dependency on a real HTTP client.
As a result, certain TLS issues previously reported by users
should no longer arise.
- The dependency tree has been significantly slimmed down when the
-
This release also updates all dependencies to the most recent version.
-
The minimum Rust version has been bumped to 1.65 (and 1.70 for the remote and standalone features).
-
-
0.6.805 Jul 2023Release notes
Open source →- This is a maintenance release that updates all dependencies to the most recent version.
- Fixes some dependency issues with the Docker image.
Release notes
Open source →- This is a maintenance release that updates all dependencies to the most recent version.
- Fixes some dependency issues with the Docker image.
-
0.6.721 Nov 2022Release notes
Open source →Version 0.6.7
- This is a maintenance release that updates all dependencies to the most recent version.
Release notes
Open source →- This is a maintenance release that updates all dependencies to the most recent version.
-
0.6.611 Jan 2022Release notes
Open source →- Extended some API methods to allow for more type flexibility (see #58). Thanks to @95th for providing the PR!
- Fixed parsing query parameter values that contain
+to represent space (see #56). Thanks to @95th for providing the PR! - Added a new Cargo feature
cookieto shorten compile time (see #63). Thanks to mythmon for providing this PR!
Release notes
Open source →- Extended some API methods to allow for more type flexibility (see https://github.com/httpmock/httpmock/issues/58). Thanks to @95th for providing the PR!
- Fixed parsing query parameter values that contain
+to represent space (see https://github.com/httpmock/httpmock/issues/56). Thanks to @95th for providing the PR! - Added a new Cargo feature
cookieto shorten compile time (see https://github.com/httpmock/httpmock/pull/63). Thanks to mythmon for providing this PR!
-
0.6.522 Dec 2021Release notes
Open source →- Fixes a race condition that could occur when deleting mocks from the mock server (see https://github.com/httpmock/httpmock/issues/53).
- Replaced internal diff library (switched from
differencetosimilar, see https://github.com/httpmock/httpmock/pull/55).
-
0.6.415 Nov 2021Release notes
Open source →- Fixed minimum Rust version in README (raised from 1.47 to 1.54, see release 0.6.3 for more information).
-
0.6.315 Nov 2021Release notes
Open source →- This is a maintenance release that updates all dependencies to the most recent version.
- Bumped minimum Rust version to 1.54 due to transitive dependency.
-
0.6.213 Aug 2021Release notes
Open source →- A bug was fixed that has unexported the When and Then structures. Both types are now exported again. Please refer to https://github.com/httpmock/httpmock/issues/47 for more info.
-
0.6.111 Aug 2021Release notes
Open source →- This is a maintenance release that updates all dependencies to the most recent version.
-
0.6.011 Aug 2021Release notes
Open source →General
- Old Mock structure based API was deprecated starting from version 0.5.0 and was removed with this version. Please switch to the new API based on the When / Then structures.
- The two methods
MockRef::times_calledandMockRef::times_called_asyncwere deprecated since version 0.5.0 and have now been removed. - A prelude module was added to shorten imports
that are usually required when using
httpmockin tests. - The struct
MockRefhas been renamed toMock. - Trait
MockRefExthas been renamed toMockExt. - Added support for x-www-form-urlencoded request bodies.
Standalone Mock Server
- Standalone server now has a request history limit that can be adjusted.
- All standalone servers parameters now have an environment variable fallback.
- Standalone servers
exposedanddisable_access_logparameters were changed, so that they now require a value in addition to the flag itself (this is due to a limitation ofstructopt/clap): Before:httpmock --expose, Now:httpmock --expose true.
-
0.5.818 Apr 2021Release notes
Open source →- A bug has been fixed that prevented to use the mock server for requests containing a
multipart/form-datarequest body with binary data.
- A bug has been fixed that prevented to use the mock server for requests containing a
-
0.5.722 Mar 2021Release notes
Open source →- Added static mock support based on YAML files for standalone mode.
- Dockerfile Rust version has been fixed.
- Documentation on query parameters has been enhanced.
- Bumped minimum Rust version to 1.46 due to transitive dependency.
-
0.5.612 Mar 2021Release notes
Open source →- A bug has been fixed that caused false positive warnings in the log output.
- Updated all dependencies to the most recent versions.
- Assertion error messages (
MockRef::assertandMockRef::assert_hits) now contain more details.
-
0.5.6-beta.111 Mar 2021 pre-releaseNothing published for this version
-
0.5.6-beta.011 Mar 2021 pre-releaseNothing published for this version
-
0.5.528 Jan 2021Release notes
Open source →- A bug has been fixed that prevented to use a request body in DELETE requests.
-
0.5.415 Jan 2021Release notes
Open source →- A new extension trait
MockRefExtwas added that extends theMockRefstructure with additional but usually not required functionality.
- A new extension trait
-
0.5.4-alpha.008 Jan 2021 pre-releaseNothing published for this version
-
0.5.307 Jan 2021Release notes
Open source →- This is a maintenance release that updates all dependencies to the most recent version.
- This release bumps the minimal Rust version from 1.43+ to 1.45+.
-
0.5.225 Oct 2020Release notes
Open source →- Updated dependencies to newest version.
- Removed dependency version fixation from v0.5.1.
Mock::return_body_from_fileandThen::body_from_filenow accept absolute and relative file paths.
-
0.5.124 Oct 2020Release notes
Open source →- Updated dependency to futures-util to fix compile errors.
- Fixed all dependency version numbers to avoid future problems with new dependency version releases.
-
0.5.012 Oct 2020Release notes
Open source →- ❌ Breaking Change: Function
Mock::expect_json_bodywas renamed toexpect_json_body_obj. - ❌ Breaking Change: Function
Mock::return_json_bodywas renamed toreturn_json_body_obj. - 🚀 Attention: A new API for mock definition was added. The old API is still available and functional, but is deprecated from now on. Please consider switching to the new API.
- 🚀 Attention: The following new assertion functions have been added that will provide you smart and helpful
error output to support debugging:
MockRef::assertMockRef::assert_hitsMockRef::assert_asyncMockRef::assert_hits_async
- The two methods
MockRef::times_calledandMockRef::times_called_asyncare now deprecated. Consider usingMockRef::hitsandMockRef::hits_async. - The two methods
Mock::return_bodyandThen::bodynow accept binary content. - The following new methods accept a
serde_json::Value:Mock::expect_json_bodyMock::return_json_bodyWhen::json_bodyThen::json_body
- 🔥 Improved documentation (a lot!).
- 👏 Debug log output is now pretty printed!
- 🍪 Cookie matching support.
- Support for convenient temporary and permanent redirect.
- The log level of some log messages was changed from
debugtotraceto make debugging easier.
- ❌ Breaking Change: Function
-
0.5.0-beta.109 Oct 2020 pre-releaseNothing published for this version
-
0.4.518 Sep 2020Release notes
Open source →- Improved documentation.
- Added a new function
base_urlto theMockServerstructure.
-
0.4.418 Sep 2020Nothing published for this version
-
0.4.317 Aug 2020Nothing published for this version
-
0.4.209 Jul 2020Nothing published for this version
-
0.4.109 Jul 2020Nothing published for this version
-
0.4.003 Jul 2020Nothing published for this version
-
0.3.529 Apr 2020Nothing published for this version
-
0.3.430 Jan 2020Nothing published for this version
-
0.3.303 Oct 2019Nothing published for this version
-
0.3.202 Oct 2019Nothing published for this version
-
0.3.102 Oct 2019Nothing published for this version
-
0.3.002 Oct 2019Nothing published for this version
-
0.2.025 Sep 2019Nothing published for this version
-
0.1.022 Sep 2019Nothing published for this version