Open 4np opened 10 years ago
+1 I am using the URIBuilder to generate a URL which correctly encodes the parameters. If I pass that URL to the RestBuilder instance it reencodes everything.
So for instance, if I generate a URL like this using the URIBuilder:
http://biocache.ala.org.au/ws/occurrences/search?q=cl22%3A%22New+South+Wales%22&facets=taxon_name&pageSize=0&flimit=50&foffset=0&fq=species_group%3A%22Mammals%22
the actual request looks something like this:
http://biocache.ala.org.au/ws/occurrences/search?q=cl22%253A%2522New%2BSouth%2BWales%2522&fq=species_group%253A%2522Mammals%2522
If I decode to UTF-8 before using the rest builder then it works unless there is an ampersand, "&", within the parameter values.
Using the Groovy RESTClient for the time being. If I have time I will look into the problem and hopefully send a PR
+1 Re-encoding is a bummer.
Hi Graeme,
I am using the plugin to consume a Jenkins instance, but some of the view names in there contain (out of my control) spaces. These result in URLs containing spaces (e.g. http://my.jenkins.instance.com/job/something/view/foo%20bar/api/json ). Such URLs fail due to a 404. I assume because the %20 get's url decoded and a request is done with a real space or something.
Example code: