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

Method SetFormDataFromValues

request.go:167–177  ·  view source on GitHub ↗

SetFormDataFromValues set the form data from url.Values, will not been used if request method does not allow payload.

(data urlpkg.Values)

Source from the content-addressed store, hash-verified

165// SetFormDataFromValues set the form data from url.Values, will not
166// been used if request method does not allow payload.
167func (r *Request) SetFormDataFromValues(data urlpkg.Values) *Request {
168 if r.FormData == nil {
169 r.FormData = urlpkg.Values{}
170 }
171 for k, v := range data {
172 for _, kv := range v {
173 r.FormData.Add(k, kv)
174 }
175 }
176 return r
177}
178
179// SetFormData set the form data from a map, will not been used
180// if request method does not allow payload.

Callers 3

parseRequestBodyFunction · 0.80
SetFormDataFromValuesFunction · 0.80
testFormFunction · 0.80

Calls 1

AddMethod · 0.80

Tested by 1

testFormFunction · 0.64