MCPcopy
hub / github.com/gin-gonic/gin / createFormPostRequest

Function createFormPostRequest

binding/binding_test.go:503–508  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

501}
502
503func createFormPostRequest(t *testing.T) *http.Request {
504 req, err := http.NewRequest(http.MethodPost, "/?foo=getfoo&bar=getbar", bytes.NewBufferString("foo=bar&bar=foo"))
505 require.NoError(t, err)
506 req.Header.Set("Content-Type", MIMEPOSTForm)
507 return req
508}
509
510func createDefaultFormPostRequest(t *testing.T) *http.Request {
511 req, err := http.NewRequest(http.MethodPost, "/?foo=getfoo&bar=getbar", bytes.NewBufferString("foo=bar"))

Callers 1

TestBindingFormPostFunction · 0.85

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected