Add the support of form data (without binary data), and set the value of the Content-Type field in the request header to application/x-www-form-urlencoded.
- For
url.Values object, just call the Encoded method to encode it.
- For struct and map, check the type of all fields, convert the values to the strings, and encode them like
url.Values object.
Example code
data := SomeType{
F1: "Value 1",
F2: 2,
// and other data...
}
Request(dest, RequestConfig{
Body: data,
ContentType: "form"
})
// f1=Value 1&f2=2 // ...
Add the support of form data (without binary data), and set the value of the
Content-Typefield in the request header toapplication/x-www-form-urlencoded.url.Valuesobject, just call theEncodedmethod to encode it.url.Valuesobject.Example code