0

I'm using HttpGet to return a file, and HttpGet doesn't allow the argument to be a URL, it has to be a URL, however the problem I face is that I have* to use httpclient, and I need to be able to put special characters in the URI/URL e.g. square brackets so:

http://127.0.0.1:8080/exists/rest/db/catalog?_query=//album[contains(title,"")]

What can I do?

pad
  • 41,040
  • 7
  • 92
  • 166
chutsu
  • 13,612
  • 19
  • 65
  • 86

1 Answers1

3

URLEncode the portion of the url containing the special chars before passing to HttpGet with URLEncoder.encode(yourQueryString,"UTF-8");

Chris
  • 22,923
  • 4
  • 56
  • 50