android - Java - Keep getting a path error even after using urlencode -


i'm trying httpget.

here string being passed:

fullstring = "?none=" + node1 + "&ntwo=" + node2 + "&nthree=" + node3 + "&nfour=" + node4 + "&power=" + power + "&color=" + colorrgb; 

all variables single integer except color 9 digits.

that string passed function doing following:

string get_url = urlencoder.encode("http://192.168.30.80/" + str, "utf-8"); httpclient client = new defaulthttpclient(); httpget httpget; responsehandler<string> responsehandler = new basicresponsehandler(); httpget = new httpget(get_url); string content = client.execute(httpget, responsehandler); 

i tried:

string get_url = "http://192.168.30.80/" + str;  

but gave me illegal character error. after trying urlencode a:

java.lang.illegalstateexception: target host must not null, or set in parameters. scheme=null, host=null, path=http://192.168.30.80/[ljava.lang.string;@1a50d830 

why can't string? (obviously first attempt android/java)
please me understand going wrong, thanks.

urlencoder.encode not encode full url should used values of parameters.

eg.

fullstring = "?none=" + urlencoder.encode(node1, "utf-8"); fullstring += "&ntwo=" + urlencoder.encode(node2, "utf-8"); 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -