MCPcopy Index your code
hub / github.com/imroc/req / SetFormData

Method SetFormData

request.go:181–189  ·  view source on GitHub ↗

SetFormData set the form data from a map, will not been used if request method does not allow payload.

(data map[string]string)

Source from the content-addressed store, hash-verified

179// SetFormData set the form data from a map, will not been used
180// if request method does not allow payload.
181func (r *Request) SetFormData(data map[string]string) *Request {
182 if r.FormData == nil {
183 r.FormData = urlpkg.Values{}
184 }
185 for k, v := range data {
186 r.FormData.Set(k, v)
187 }
188 return r
189}
190
191// SetOrderedFormData set the ordered form data from key-values pairs.
192func (r *Request) SetOrderedFormData(kvs ...string) *Request {

Callers 5

SetFormDataFunction · 0.80
testFormFunction · 0.80
TestUploadMultipartFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 3

testFormFunction · 0.64
TestUploadMultipartFunction · 0.64