java
1 URL obj = new URL(url); 2 HttpURLConnection con = (HttpURLConnection) obj.openConnection(); 3 4 5 con.setRequestMethod("POST"); 6 con.setRequestProperty("Host","somedomain.com"); 7 con.setRequestProperty("Content-Type","application/x-www-form-urlencoded;charset=UTF-8"); 8 con.setRequestProperty("Content-Length", "30"); 9 10 System.out.println("### getRequestProperty Host : " + con.getRequestProperty("Host") ); 11 System.out.println("### getRequestProperty Content-Type : " + con.getRequestProperty("Content-Type") ); 12 System.out.println("### getRequestProperty Content-Length : " + con.getRequestProperty("Content-Length") );
上記のようなコードを書いたのですが、
セットしたはずのプロパティがきえてしまいます。
何故かご存知のかたいらっしゃらないでしょうか。
Java7 Tomcat6です。
### getRequestProperty Host : null ### getRequestProperty Content-Type : application/x-www-form-urlencoded;charset=UTF-8 ### getRequestProperty Content-Length : null

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/02/25 15:49