Registry / testing / maxcnunes-httpfake

maxcnunes-httpfake

JSON →
library1.2.4gogounverified

A simple HTTP test server wrapper with a chainable API for setting up fake handlers.

go get github.com/maxcnunes/httpfake
INSTALL
IMPORT
SIG · MAXCNUNES-HTTPFAKE
M
maxcnunes-httpfake
testinggov1.2.4
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.

httpfake
github.com/maxcnunes/httpfake

Create a fake HTTP server and make a request to it.

package main import ( "fmt" "net/http" "github.com/maxcnunes/httpfake" ) func main() { fake := httpfake.New() defer fake.Server.Close() fake.Get("/api").Reply(200).BodyString(`{"status":"ok"}`) resp, _ := http.Get(fake.URL() + "/api") fmt.Println(resp.StatusCode) }
Debug
Known issues

No known issues recorded.

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

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Resources
maxcnunes-httpfake — go get maxcnunes-httpfake · libregistry