hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karthik <kart...@apple.com>
Subject Re: Java Object Serialization and Tomcat Basic Authentication Incompatibility?
Date Tue, 30 Aug 2005 16:00:32 GMT
Looks like I might be able to answer my own question.

I used httpclient 3.0 rc3 and made the following changes to the  
client code:

         ByteArrayRequestEntity output = new ByteArrayRequestEntity 
(buf);
         HttpClient client = new HttpClient();

         client.getState().setCredentials(
             new AuthScope(null, 8080,null),
             new UsernamePasswordCredentials("iss", "iss")
         );

         String url = "http://localhost:8080/httpclient/httpclient";

         PostMethod method = new PostMethod(url);

         method.setRequestEntity(output);
         //method.setRequestContentLength((int)buf.length);
         method.setRequestHeader("Content-Type", "application/octet- 
stream");
         method.setRequestHeader("Connection", "Keep-Alive");
         method.setDoAuthentication( true );

and stuff seems to work.

Thanks, Karthik


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message