我嘗試使用下面的代碼來執行以下鏈接:安卓HTTPGET問題
class httpget{
HttpGet httpGet=null;
public void linkexecute(){
String url="http://<server>/<path>/action=send&msg=new message";
httpGet= new HttpGet(url); // line 1
....
}
at line 1 it is giving error "Illegal arguement exception"
java.lang.IllegalArgumentException: Illegal character in query at index 77: http://<server>/<path>/sms.json?action=send&msg=new message
at java.net.URI.create(URI.java:970)
at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:75)
at com.sms.login.LoginService.sendSms(LoginService.java:143)
而有低於其在的「味精=」
String url="http://<server>/<path>/action=send&msg=newmessage";
話沒有間隙URL發出任何錯誤
如何解決URL中文字間隙問題?
你能發佈完整的網址嗎? – 2011-03-14 06:19:30