Reputation: 131
how do i resolve this error ?
HttpClient httpclient = new DefaultHttpClient();
String link="http://myurl.com/Acces/DEFAULT2.ASPX?+ivrsDetails.getAssetid()"+"\""+ivrsDetails.getTime();
HttpPost httppost = new HttpPost(link);
Illegal character in query at index 62: http://myurl.com/Acces/DEFAULT2.ASPX?+Details.getAssetid()"17:47:21
Upvotes: 0
Views: 2080
Reputation: 131
I used url encode and it worked fine ....
HttpClient httpclient = new DefaultHttpClient();
String link="http://myurl.com/Acces/DEFAULT2.ASPX?+ivrsDetails.getAssetid()"+ URLEncoder.encode("\\")+ivrsDetails.getTime();
HttpPost httppost = new HttpPost(link);
Is this a good way to make it work?
Upvotes: 0
Reputation: 38429
try below code :-
String link="http://myurl.com/Acces/DEFAULT2.ASPX?+ivrsDetails.getAssetid()"+"\\"+ivrsDetails.getTime();
we are using \ (backslash character) for reading special character after using \ (backslash character).
http://www.javapractices.com/topic/TopicAction.do?Id=96
http://docs.oracle.com/javase/jndi/tutorial/beyond/names/syntax.html
Upvotes: 0
Reputation: 945
Try this one...You have inserted an unmatched quote in the url
"http://myurl.com/Acces/DEFAULT2.ASPX?+ivrsDetails.getAssetid()"+"\\"+ivrsDetails.getTime();
Upvotes: 1