form
form copied to clipboard
map[string]string encode/decode
fv, _ := form.NewEncoder().Encode(map[string]string{"a": "b"})
fmt.Printf(`the str="%s"`+"\n", fv.Encode())
the str="%5Ba%5D=b"
i will httpPost(xxx, encodeIt(x))
strmap := map[string]string{}
form.NewDecoder().Decode(&strmap, url.Values{"a": []string{"b"}}) // FormValue <= http://xx.com/?a=b
fmt.Println(strmap)