package main
import (
"fmt"
"github.com/gogf/gf/v2/encoding/gurl"
"net/url"
)
func main() {
// 构建url参数
values := url.Values{}
values.Add("name", "gopher")
values.Add("limit", "20")
values.Add("page", "7")
// 生成URL编码查询字符串 limit=20&name=gopher&page=7
urlStr := gurl.BuildQuery(values)
fmt.Println(urlStr)
}
2 Comments
CHEN
CHEN