How do I URL-encode URLs?

URL encoding stands for encoding certain characters in a URL by replacing them with one or more character triplets that consist of the percent character "%" followed by two hexadecimal digits. The two hexadecimal digits of the triplet(s) represent the numeric value of the replaced character.

Encode the URL and add as a parameter to the request. The URL can easily be encoded with javascript, for instance encodeURIComponent(location.href). Read more about it Here or Here.