I have the following URL:
https://api-test.company.com/contacts?q=email=“jlowder@company.com”
I am parsing it using:
String URL = "https://api-test.company.com/contacts?" + URLEncoder.encode("q=email=jlowder@company.com", "UTF-8");
I have also tried “ISO-8859-1”, but both return this for my URL:
https://api-test.homeaway.com/contacts?q%3Demail%3Djlowder%40homeaway.com
In order to receive the correct response from my server, I need the url to be:
https://api-test.company.com/contacts?q=email=%22jlowder@company.com%22
The %22 is the ” ” marks around the email address.
How do I go about forming the correct URL? None of the examples I can find do this..
If you really want this, then you have to put the quotes also into the string:
gives:
https://api-test.company.com/contacts?q=email=%22jlowder%40company.com%22btw.: You want to name that String
url, notURL.