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
This commit is contained in:
parent
3b83e64bd3
commit
17bdf398eb
2 changed files with 14 additions and 0 deletions
|
@ -149,6 +149,14 @@ public class HTTPURLConnection
|
|||
final Credentials creds = (username == null) ? null :
|
||||
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;
|
||||
do
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue