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

Method SetCommonFormDataFromValues

client.go:221–231  ·  view source on GitHub ↗

SetCommonFormDataFromValues set the form data from url.Values for requests fired from the client which request method allows payload.

(data urlpkg.Values)

Source from the content-addressed store, hash-verified

219// SetCommonFormDataFromValues set the form data from url.Values for requests
220// fired from the client which request method allows payload.
221func (c *Client) SetCommonFormDataFromValues(data urlpkg.Values) *Client {
222 if c.FormData == nil {
223 c.FormData = urlpkg.Values{}
224 }
225 for k, v := range data {
226 for _, kv := range v {
227 c.FormData.Add(k, kv)
228 }
229 }
230 return c
231}
232
233// SetCommonFormData set the form data from map for requests fired from the client
234// which request method allows payload.

Callers 2

Calls 1

AddMethod · 0.80

Tested by 1