异常"非法字符在索引查询 - "在Android中 [英] Exception "Illegal character in query at index -" in Android

查看:180
本文介绍了异常"非法字符在索引查询 - "在Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用下面的链接继续发送的服务器数据。

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

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

如果我设定一个字符串的文件数据。(例如:数据=文本1),这一次在源$ C ​​$ C我try块工作正常,没有任何异常。

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

不过,当我设置多个字符串用空格(如:数据=文本1文本2文字3)数据字段,然后产生例外,即在查询非法字符

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

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

我的问题是,为什么例外产生当我们使用多个字符串(如:数据=我的名字是XYZ)

如果我更换一个字符串那个时候是工作的罚款数据字段。(数据= XYZ)

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

推荐答案

恩code 空格%20 看看这一个多编码

这篇关于异常"非法字符在索引查询 - "在Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆