getresponse - Codenameone getResponseData -


i have following code...

    // register new user     connectionrequest r = new connectionrequest();      r.seturl(surlwebsvc);     r.setpost(true);      r.addargument("rest", "1");          //      r.addargument("req", "register");    // r = register     r.addargument("username",     findfield(f, "txtusername"));         r.addargument("password",     findfield(f, "txtpassword"));     r.addargument("firstname",    findfield(f, "txtfirstname"));     r.addargument("lastname",     findfield(f, "txtlastname"));     r.addargument("address",      findfield(f, "txtaddress"));     r.addargument("city",         findfield(f, "txtcity"));     r.addargument("state",        findfield(f, "txtstate"));     r.addargument("zipcode",      findfield(f, "txtzipcode"));     r.addargument("email",        findfield(f, "txtemail"));     // show spinning dialog while connecting     infiniteprogress prog = new infiniteprogress();     dialog dlg = prog.showinifiniteblocking();     r.setdisposeoncompletion(dlg);     networkmanager.getinstance().addtoqueueandwait(r);     byte[] temp = r.getresponsedata(); 

could please explain how responsed data hash table can lookup various items...

is response in json format or in xml format or csv?

assuming json format can use:

jsonparser p = new jsonparser(); hashtable h = p.parse(new inputstreamreader(new bytearrayinputstream(temp)); 

with xml hierarchy element object can traverse xmlparser pretty similar. check out codename 1 developer guide further details.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -