Closed roanosullivan closed 11 years ago
For what it's worth, URIBuilder in Apache HttpClient works:
=> (import '[org.apache.http.client.utils URIBuilder])
org.apache.http.client.utils.URIBuilder
=> (def src "/orders/2013/Q1?results=2013_Q1_hide_empty.png")
#'oe-metrics-ui.server/src
=> (str (.build (.setParameter (URIBuilder. src) "results" "2013_Q1_show_empty.png")))
"/orders/2013/Q1?results=2013_Q1_show_empty.png"
But I would prefer not to depend on [org.apache.httpcomponents/httpclient "4.2.3"].
This should be fixed now in version 0.3.2. The underlying issue is that there was a bug with parsing relative URIs.
Works for me with 0.3.2:
=> (use '[org.bovinegenius.exploding-fish :as uri])
nil
=> (uri/param "/orders/2013/Q1?results=2013_Q1_hide_empty.png" "results" "2013_Q1_show_empty.png")
"/orders/2013/Q1?results=2013_Q1_show_empty.png"
I had been using 0.3.1.
Thanks!
The
param
function does not seem to be working with relative URIs.For example, the following function call will result in the
results
param being duplicated:My understanding of docs is that the old param value should replaced with the new param value, in which case the above behavior is incorrect.