go-resty / resty

Simple HTTP and REST client library for Go
MIT License
9.98k stars 706 forks source link

Path param encoding is broken #781

Closed sakateka closed 7 months ago

sakateka commented 7 months ago

Hi! I have the following code example.

c.SetBaseURL("https://example.com/prefix")
r.SetPathParam("first", "1").
        SetPathParam("second", "2")
r.Get("{first}/{second}")

And after the release v2.10.0-rc.1 this example started failing. The debug logs show the following

GET /prefix/%7Bfirst%7D/%7Bsecond%7D
HOST   :  example.com

I wrote the test and corrected the code, the PR is attached.