wnanbei / direwolf

Package direwolf is a convenient and easy to use http client written in Golang.
https://wnanbei.github.io/direwolf/
MIT License
43 stars 3 forks source link

Params not work as expected #2

Closed wangwu50 closed 4 years ago

wangwu50 commented 4 years ago
params := df.NewParams("aa", "bb")

resp, err := df.Get("https://httpbin.org/get?ss=sd",params)

if err != nil {
    return
}

fmt.Println(resp.Text())

return

{
  "args": {
    "ss": "sd?aa=bb"
  }, 
  "headers": {
    "Accept-Encoding": "gzip", 
    "Host": "httpbin.org", 
    "User-Agent": "direwolf - winter is coming"
  }, 
  "origin": "123.103.48.253, 123.103.48.253", 
  "url": "https://httpbin.org/get?ss=sd%3Faa=bb"
}

Seems like Params's bindRequest method not taking into account the fact that there are parameters on the url

wnanbei commented 4 years ago

Thank you, i will fix this problem as soon as possible