This commit is contained in:
2020-02-10 00:06:14 +08:00
parent 8ead1d6020
commit f335497984

18
single_file_tests/url.go Normal file
View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
"strings"
"net/url"
)
func main() {
q := url.Values{}
q.Add("b", "testing")
q.Add("a", "hello world")
// url.Values will sort keys(alphabet asc)
// and encode ' '(blank) to '+', SHOULD replace to '%20'
s := strings.ReplaceAll(q.Encode(), "+", "%20")
fmt.Println(s)
}