- From: Edison Aspert <aspertedison@yahoo.com>
- Date: Mon, 18 Dec 2000 15:47:18 -0800 (PST)
- To: www-jigsaw@w3.org
Hi, I am trying to download a file from www.cel.com. Here is the code HttpManager manager = HttpManager.getManager() ; CookieFilter cflt = new CookieFilter(); cflt.initialize(manager); Request request = manager.createRequest() ; request.setMethod("GET") ; request.setURL(new URL("http://www.cel.com/")); Reply reply = manager.runRequest(request) ; while(reply.getStatus() == 302) { System.out.println("Reply Header Descriptions:"); Enumeration e = reply.enumerateHeaderDescriptions(); while(e.hasMoreElements()) { System.out.println(((HeaderDescription) e.nextElement())).getName()); } String redirectURL = reply.getLocation(); System.out.println("Redirect "+redirectURL); StringBuffer buf = new StringBuffer("http://www.cel.com"); buf.append(redirectURL); redirectURL = buf.toString(); System.out.println("Redirect URL "+redirectURL); request.setUserAgent("Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)"); request = manager.createRequest(); request.setURL(new URL(redirectURL)); //cflt.initialize(manager); reply = manager.runRequest(request); } InputStream in = reply.getInputStream() ; BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in)); String inputLine; while ((inputLine = bufferedReader.readLine()) != null) { System.out.println(inputLine); } I am getting a error page saying that my application does not support cookies. Aspert Edison __________________________________________________ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/
Received on Monday, 18 December 2000 18:47:27 UTC