java - Use cookie with Httpclient on Android -



java - Use cookie with Httpclient on Android -

i'm trying session cookies when authenticate user don't understand witch way best httpclient.

public void postdata() { // create new httpclient , post header httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("http://www.yoursite.com/script.php"); seek { // add together info list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(2); namevaluepairs.add(new basicnamevaluepair("id", "12345")); namevaluepairs.add(new basicnamevaluepair("stringdata", "anddev cool!")); httppost.setentity(new urlencodedformentity(namevaluepairs)); // execute http post request httpresponse response = httpclient.execute(httppost); } grab (clientprotocolexception e) { // todo auto-generated grab block } grab (ioexception e) { // todo auto-generated grab block }}

java android cookies httpclient

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -