Registry / testing / jarcoal-httpmock

jarcoal-httpmock

JSON →
library1.4.1gogounverified

Package httpmock provides tools for mocking HTTP responses.

go get github.com/jarcoal/httpmock
INSTALL
IMPORT
SIG · JARCOAL-HTTPMOCK
J
jarcoal-httpmock
testinggov1.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

httpmock
github.com/jarcoal/httpmock

Mock HTTP responses for testing.

package main import ( "fmt" "net/http" "github.com/jarcoal/httpmock" ) func main() { httpmock.Activate() httpmock.RegisterResponder("GET", "http://example.com", httpmock.NewStringResponder(200, "OK")) resp, _ := http.Get("http://example.com") fmt.Println(resp.Status) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.4.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
jarcoal-httpmock — go get jarcoal-httpmock · libregistry