Commit 17bdf398 by David Daney Committed by David Daney

re PR classpath/28661 (HTTP Header differs b/w java and classpath)

       PR classpath/28661
       * gnu/java/net/protocol/http/HTTPURLConnection.java (connect):  Add
       default content-type for POST method.

From-SVN: r117149
parent 3b83e64b
2006-09-22 David Daney <ddaney@avtrex.com>
PR classpath/28661
* gnu/java/net/protocol/http/HTTPURLConnection.java (connect): Add
default content-type for POST method.
2006-09-20 Gary Benson <gbenson@redhat.com> 2006-09-20 Gary Benson <gbenson@redhat.com>
* java/net/InetAddress.java: Updated to latest. * java/net/InetAddress.java: Updated to latest.
......
...@@ -149,6 +149,14 @@ public class HTTPURLConnection ...@@ -149,6 +149,14 @@ public class HTTPURLConnection
final Credentials creds = (username == null) ? null : final Credentials creds = (username == null) ? null :
new Credentials (username, password); new Credentials (username, password);
if ("POST".equals(method))
{
String contentType = requestHeaders.getValue("Content-Type");
if (null == contentType)
requestHeaders.addValue("Content-Type",
"application/x-www-form-urlencoded");
}
boolean retry; boolean retry;
do do
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment