hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mugoma Joseph Okomba" <mug...@yengas.com>
Subject java.net.URISyntaxException: Illegal character in query
Date Tue, 05 Jun 2012 00:41:08 GMT
Hello,

While trying to use HttpClient 4.2 to download page I am getting:

java.net.URISyntaxException: Illegal character in query at index 85:
http://www.target.com/webapp/wcs/stores/servlet/s?searchTerm=Jared+Diamond&category=0|All|matchallany|all+categories


On HttpClient 3.x I get similar error:

java.lang.IllegalArgumentException: Invalid uri
'http://www.target.com/webapp/wcs/stores/servlet/s?searchTerm=Jared+Diamond&category=0|All|matchallany|all+categories':
Invalid query


However using the native Java download causes no error:

URL getURL = new URL(url);
HttpURLConnection huc =  ( HttpURLConnection )  getURL.openConnection ();
huc.setRequestMethod("GET");
InputStream inps = null;
	try{
		huc.connect();
		inps = (InputStream) huc.getInputStream();
	}


The URL is valid and accessible. How can one make HttpClient resolve such
URL?

Thanks.

Mugoma Joseph.





---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message