Say I have a URL
http://example.com/query?q=
and I have a query entered by the user such as:
random word £500 bank
Apache Http Components library provides a neat option for building and encoding query params -
With HttpComponents 4.x use - URLEncodedUtils
For HttpClient 3.x use - EncodingUtil