简体   繁体   中英

Exception “Illegal character in query at index -” in Android

I am trying to send data on server using following link.

**WEBSERVICE LINK:**
http://75.125.237.76/post_reviews.php?data=text1

If I set data filed with single string (ex:data=text1), That time my try block in source code working fine, without any exception.

But When I set data field with multiple string with spaces (ex: data=text1 text2 text3), Then Exception generated ie Illegal character in query.

**EXCEPTION:**
Illegal character in query at index 75: http://75.125.237.76/post_reviews.php?data=text1 text2 text3

My question is Why exception generate when we use multiple strings (like: data=My name is xyz).

If I replace data field with single string that time is working fine.(data=xyz)

使用%20编码space可以查看此编码以获得更多编码

对URI字符串进行编码,使空格显示为%20

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM