Closed shriphani closed 11 years ago
resolve-path only resolves the path. The query string isn't part of the path.
You should be able to do this though:
user> (-> "http://foo.com/forumdisplay.php?f=25" (uri/resolve-path "showthread.php") (uri/query "t=10"))
"http://foo.com/showthread.php?t=10"
user> (-> "http://foo.com/" (uri/resolve-path "showthread.php") (uri/query "t=10"))
"http://foo.com/showthread.php?t=10"
You can also set individual query params:
user> (uri/param "http://foo.com/showthread.php?t=25" "t" "10")
"http://foo.com/showthread.php?t=10"
Yeah that is what I have currently. Would it be better to have a method that resolves uris correctly (like a browser would)?
Yeah, that's not a bad idea. Maybe I'll take a look at it tomorrow.
This should be fixed. I merged Pull Request #9, and I made a small change to it so you can resolve against types other than String. I'll likely make a new release soon.
I have provided a few examples here:
For the above examples I would expect: "http://foo.com/showthread.php?t=10" "http://foo.com/showthread.php?t=10"
What is going wrong - is there a quick-fix I could use?