(t *testing.T)
| 579 | } |
| 580 | |
| 581 | func createFormMultipartRequest(t *testing.T) *http.Request { |
| 582 | boundary := "--testboundary" |
| 583 | body := new(bytes.Buffer) |
| 584 | mw := multipart.NewWriter(body) |
| 585 | defer mw.Close() |
| 586 | |
| 587 | require.NoError(t, mw.SetBoundary(boundary)) |
| 588 | require.NoError(t, mw.WriteField("foo", "bar")) |
| 589 | require.NoError(t, mw.WriteField("bar", "foo")) |
| 590 | req, err := http.NewRequest(http.MethodPost, "/?foo=getfoo&bar=getbar", body) |
| 591 | require.NoError(t, err) |
| 592 | req.Header.Set("Content-Type", MIMEMultipartPOSTForm+"; boundary="+boundary) |
| 593 | return req |
| 594 | } |
| 595 | |
| 596 | func createFormMultipartRequestForMap(t *testing.T) *http.Request { |
| 597 | boundary := "--testboundary" |
no test coverage detected