hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pill, Juergen" <Juergen.P...@softwareag.com>
Subject RE: FW: [PATCH] PreEmptive authentication setting
Date Thu, 16 Jan 2003 14:35:22 GMT
Hello Ortwin,

Our code looks always very similar to following fragment:


        HttpClient client = new HttpClient();
        HttpState state = new WebdavState();
        Credentials cred = new UsernamePasswordCredentials("webdavuser1",
"webdavuser1");
        client.startSession("pcjpl", 4000);
        state.setCredentials(null, cred);
        client.setState(state);
        PutMethod method = new
PutMethod("/taminowebdavserver/mypictures/aaa.txt");
        String s = "Hello this is a test in one line that is longer
12345677890\n";
        s =
s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s+s;
        byte[] body = s.getBytes();
        method.setRequestHeader("Content-Length", ""+body.length);
        method.setRequestBody(body);
            try {
                client.executeMethod(method);
                client.endSession();
            } catch (java.io.IOException e) {
                e.printStackTrace();
            }
        }


1) create a HttpClient
2) execute one or many methods within this HtppClient


We could set it on the method level, but I feel there should be a more
general way to set it (so we did it in HttpClient).

Best regards,

Juergen




 -----Original Message-----
From: 	Ortwin Gl├╝ck [mailto:ortwin.glueck@nose.ch] 
Sent:	Thursday, January 16, 2003 15.30 PM
To:	Commons HttpClient Project
Subject:	Re: FW: [PATCH] PreEmptive authentication setting

I think it is odd to pass the preemvtiveauth flag down to the connection 
level. This is not a per-connection property but a per request property 
/ per httpclient property.




--
To unsubscribe, e-mail:
<mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-httpclient-dev-help@jakarta.apache.org>

Mime
View raw message