HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽
Home Page:https://pkg.go.dev/github.com/h2non/gock
Geek Repo:Geek Repo
Github PK Tool:Github PK Tool
h2non opened this issue 8 years ago · comments
Instead of Reply(code), use:
gock.New("https://google.com"). Get("/foo"). ReplyFunc(func (r *gock.Response) { r.StatusCode = 200 r.Header.Set("foo", "bar") })
Done and shipped in 0.1.5.
0.1.5