java - Is there any way to use firefox's cookies with the Apache HttpClient class? -


i don't know ton cookies, if they'd compatible, etc, etc. if possible, can show example of how?

i'm not quite sure mean "use firefox cookies". here's snipet of code wrote grab data goolge reader api, passing cookie along apache httpclient request.

it needs send cookie google gives upon connection ("sid") along request. looking for?

// obtain sid     getmethod getlogin = new getmethod("https://www.google.com/accounts/clientlogin?service=reader&email="+             login+"&passwd="+password);     client.executemethod(getlogin);     string logintext = getlogin.getresponsebodyasstring();     // value of sid logintext.substring (4,firstlinelength)     bufferedreader reader = new bufferedreader(new stringreader(logintext));     string sid = logintext.substring(4, reader.readline().length() );  getmethod grabdata = new getmethod("http://www.google.com/reader/atom/user/-/state/com.google/broadcast"); grabdata.setrequestheader("cookie", "sid="+sid); client.executemethod(grabdata); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -