Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android IllegalArgumentException:查询中的非法字符_Android_Json_Url_Illegalargumentexception_Illegal Characters - Fatal编程技术网

Android IllegalArgumentException:查询中的非法字符

Android IllegalArgumentException:查询中的非法字符,android,json,url,illegalargumentexception,illegal-characters,Android,Json,Url,Illegalargumentexception,Illegal Characters,我的url中有一个非法字符,我想它是“|” 堆栈跟踪 我浏览了之前提出的一些问题,到目前为止,我已经尝试了以下两种解决方案: 1) tried to replace | with %7C or %20 2) safeUrl = URLEncoder.encode("https://graph.facebook.com/150205375156742/feed?access_token=520625188052604|GsCYVGBJKs5N_O1AX9XrrsulrWc", "UTF-8");

我的url中有一个非法字符,我想它是“|”

堆栈跟踪

我浏览了之前提出的一些问题,到目前为止,我已经尝试了以下两种解决方案:

1) tried to replace | with %7C or %20 
2) safeUrl = URLEncoder.encode("https://graph.facebook.com/150205375156742/feed?access_token=520625188052604|GsCYVGBJKs5N_O1AX9XrrsulrWc", "UTF-8");

它们都不适合我。

A'|'不是URI中的保留字符,应该是合法的。见第2.2节。你怎么知道不是呢?如果您遇到异常,请发布堆栈跟踪。我对此不是很确定。如果是这样,您能否指导我使用正确的解决方案。请在普通浏览器中检查您的url是否有效。您调用的哪个方法会导致发布的异常?使用json解析此url
1) tried to replace | with %7C or %20 
2) safeUrl = URLEncoder.encode("https://graph.facebook.com/150205375156742/feed?access_token=520625188052604|GsCYVGBJKs5N_O1AX9XrrsulrWc", "UTF-8");