First of all I CANNOT change that URL.... that said... I have a really dumb problem, I am getting this error:
Caused by: java.lang.IllegalArgumentException: Host name may not be null
in the code below:
URL url = null;
try{
// encodedURL = URLEncoder.encode("elbot_e.csoica.artificial-solutions.com/cgi-bin/elbot.cgi", "UTF-8");
String urlStr = "http://elbot_e.csoica.artificial-solutions.com/cgi-bin/elbot.cgi";
url = new URL(urlStr);
URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef());
url = uri.toURL();
} catch(Exception e) {
}
HttpPost httpPost = new HttpPost(String.valueOf(url));
I have checked if the URL is valid in: http://formvalidation.io/validators/uri/ and I have discovered that the UNDERSCORE_ in the URL is messing things up and I cannot change the URL, who knows a solution or workaround for this?