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
Post a Comment