MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / TestPatchStandard

Function TestPatchStandard

pkg/httpcli/httpcli_test.go:197–222  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

195}
196
197func TestPatchStandard(t *testing.T) {
198 requestAddr := runGoHTTPServer()
199
200 req := New()
201 req.SetURL(requestAddr + "/patch")
202 req.SetHeaders(map[string]string{
203 "Authorization": "Bearer token",
204 })
205 req.SetBody(&myBody{
206 Name: "foo",
207 Email: "bar@gmail.com",
208 })
209
210 resp, err := req.PATCH()
211 if err != nil {
212 t.Fatal(err)
213 }
214
215 result := &StdResult{}
216 err = resp.BindJSON(result)
217 if err != nil {
218 t.Fatal(err)
219 }
220
221 t.Logf("%+v", result)
222}
223
224// ------------------------------------------------------------------------------------------
225

Callers

nothing calls this directly

Calls 8

runGoHTTPServerFunction · 0.85
SetURLMethod · 0.80
SetHeadersMethod · 0.80
SetBodyMethod · 0.80
PATCHMethod · 0.80
BindJSONMethod · 0.80
NewFunction · 0.70
FatalMethod · 0.45

Tested by

no test coverage detected