java - Many JSON request in same connection -
i need execute more 1 json request, can't close current connection
example code:
private string[] test(url url, final url url2) throws ioexception { string[] test = new string[2]; urlconnection openconnection = url.openconnection(); test[0] = this.formatjson(openconnection.getinputstream()); url = url2; test[1] = this.formatjson(openconnection.getinputstream()); return test; }
or
private string[] test(url url, final url url2) throws ioexception { string[] test = new string[2]; urlconnection openconnection = url.openconnection(); test[0] = this.formatjson(openconnection.getinputstream()); url.setnewurl(url2); test[1] = this.formatjson(openconnection.getinputstream()); return test; }
any options?
solved it!
to execute more 1 json request in same session need save cookies first , use him others.
this link helped me http://www.hccp.org/java-net-cookie-how-to.htm
Comments
Post a Comment