Reputation: 109
ERROR/java.lang.IllegalArgumentException(337): java.lang.IllegalArgumentException: Illegal character in query at index 136
I am getting this error when I'm trying to post data and image.
Upvotes: 5
Views: 22992
Reputation: 2366
you try
String link="http://example.php?string1="+URLEncoder.encode(string1)+"&string2="+URLEncoder
.encode(string2)+"&string3="+URLEncoder.encode(string3)+"&string4="+URLEncoder.encode(string4)+"";
Upvotes: 15
Reputation: 4968
i your name String check the character at position 337, if it is to be a unwanted white space this error use to occur. Replace the white spaces by using trim
Upvotes: 1