guonaihong / gout

gout to become the Swiss Army Knife of the http client @^^@---> gout 是http client领域的瑞士军刀,小巧,强大,犀利。具体用法可看文档,如使用迷惑或者API用得不爽都可提issues
Apache License 2.0
1.33k stars 115 forks source link

扩展GET/POST/DELETE/PATCH等接口,支持模板语法 #350

Closed guonaihong closed 1 year ago

guonaihong commented 1 year ago

样例如下:

type endpoint struct {
    Host string
    OrgName string
    AppName string
}

gout.GET("http://{{.Host}}/{{.OrgName}}/{{.AppName}}", &endpoint{Host:"demo.xx", OrgName:"测试",AppName: "测试"}).Do()

场景: 为了支持url能和结构体绑定。