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
  • 40,544
  • 7
  • 88
  • 164
chutsu
  • 13,084
  • 19
  • 62
  • 83

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,440
  • 4
  • 55
  • 49