Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 3.9% on proxy.golang.org
Top 1.8% dependent packages on proxy.golang.org
Top 2.3% dependent repos on proxy.golang.org
Top 6.8% forks on proxy.golang.org

proxy.golang.org : github.com/dankinder/httpmock

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:

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/dankinder/httpmock
Keywords: golang, http, httptest, mock
License: MIT
Latest release: 5 months ago
First release: over 5 years ago
Namespace: github.com/dankinder
Dependent packages: 9
Dependent repositories: 5
Stars: 81 on GitHub
Forks: 9 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 23 days ago

    Loading...
    Readme
    Loading...