10
HttpClientを使用したJavaでのHttp基本認証?
私はこのcurlコマンドの機能をJavaで模倣しようとしています: curl --basic --user username:password -d "" http://ipaddress/test/login Commons HttpClient 3.0を使用して以下を作成しました500 Internal Server Errorが、サーバーからを取得することになりました。私が何か間違っていることを誰かが教えてもらえますか? public class HttpBasicAuth { private static final String ENCODING = "UTF-8"; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { HttpClient client = new HttpClient(); client.getState().setCredentials( new …
156
java
http
apache-commons