JDK-4498706 : HttpURLConnection could let more control on the Http URL Connection
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-08-31
  • Updated: 2001-09-03
  • Resolved: 2001-09-03
Related Reports
Duplicate :  
Description

Name: nt126004			Date: 08/31/2001


java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-be
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
(not importan for this request)

We are creating the Internet robot for the automatic accession of the Internet
pages, provided by http://public.celera.com/cds/login.cfm . This company
requires to use password to access the content of the pages. After submitting
the valid password it sets a cookie like jrunsessionid=997440358990209455 (the
number is different for each session) and requires this cookie for each later
accession. Otherwise, all you get is message "you must be logged to access this
page".

  To use HttpURLConnection class, we would request a method to get a list of
cookies that were set during the connection, and other method to set a list of
cookies for the next connection, like:

 String [] Cookies;

 HttpURLConnection c1, c2;
 
 c1 = ...
 // connect and work with c1.
 c1.close(); // after reading the page.

 c2 = ...
 c2.setCookies(c1.getCookies());
 ... connect and work with c2.
 // c2 adds all cookies to its http request.
 ...
(Review ID: 131120) 
======================================================================

Comments
WORK AROUND Name: nt126004 Date: 08/31/2001 Customer Workaround: Ujava.net.Socket allows deeper control on the protocol, but with it we need to program following redirects and all other things that are readily available when using HttpURLConnection. ======================================================================
11-06-2004