-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b71
-
x86
-
windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2137935 | 5.0u10 | Chris Hegarty | P4 | Resolved | Fixed | b01 |
FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows XP Professional Version 2002 Service Pack 2
Linux jclinux 2.4.21-32.0.1.EL #1 Tue May 17 18:01:37 EDT 2005 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
In Java 5.0, HttpURLConnection, by defaults, sets Content-Type to application/x-www-form-urlencoded
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run code like this on JDK1.4.X and on JDK1.5 and see the value of the content-type header:
URL url = new URL(argv[0]);
HttpURLConnection connect = (HttpURLConnection) url.openConnection();
connect.setRequestMethod("GET");
connect.setDoInput(true);
connect.setDoOutput(false);
InputStream in;
in = connect.getInputStream();
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was expecting no content-type header
ACTUAL -
The request had a content-type header set to application/x-www-form-urlencoded
REPRODUCIBILITY :
This bug can be reproduced always.
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows XP Professional Version 2002 Service Pack 2
Linux jclinux 2.4.21-32.0.1.EL #1 Tue May 17 18:01:37 EDT 2005 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
In Java 5.0, HttpURLConnection, by defaults, sets Content-Type to application/x-www-form-urlencoded
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run code like this on JDK1.4.X and on JDK1.5 and see the value of the content-type header:
URL url = new URL(argv[0]);
HttpURLConnection connect = (HttpURLConnection) url.openConnection();
connect.setRequestMethod("GET");
connect.setDoInput(true);
connect.setDoOutput(false);
InputStream in;
in = connect.getInputStream();
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was expecting no content-type header
ACTUAL -
The request had a content-type header set to application/x-www-form-urlencoded
REPRODUCIBILITY :
This bug can be reproduced always.
- backported by
-
JDK-2137935 HttpURLConnection sets Content-Type to application/x-www-form-urlencoded
-
- Resolved
-