Golang http requests post Multidimensional Array form-data

how to send multidimensional arrays to post requests in go.
form-data format

is like

in php.
form := make(map[string][]string)
form["name"] = []string{"lisa","danny"}
Jul.20,2021

Yes, you can do that.

but a Values type has been defined in the net/url library, which is actually map [string] [] string written by you. You can directly assign a [] string or you can traverse your [] string and use Values's Add method

.
v := make(url.Values)
values := []string{"one", "two"}

// 
v["test"] = values
// 
for _, value := range values {
    v.Add("test", value)
}
// 

  

suggest map [string] interface {}

Menu