You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ozgur Balsoy <ba...@grids.ucs.indiana.edu> on 2002/05/26 04:16:21 UTC

HttpClient.startSession(URL, Credentials) problem

Hi guys,
I am having this problem when I use HttpClient.startSession(URL, 
Credentials) method.

I want to fetch a URL with user/pwd information. I create an HttpClient 
object, a UsernamePasswordCredentials object, and start the session 
using the above method. It gives me a NullPointerException because in 
this method, the credentials for the client's state is set to (null,creds)
public void startSession(URL url, Credentials creds) {
        getState().setCredentials(null,creds);
        startSession(url);
    }

However, in HttpState.setCredentials(String, Credentials) , the first 
parameter is a key for a map object. So, this is an unpreventable 
Exception, and I think it is a bug.

I'm using 2.0a1. The code snippet above is from the latest CVS.
Please reply your better solutions if any to my e-mail address. I am not 
subscribed to the list.

Thanks,
Ozgur Balsoy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>