How to set authentication parameters in httpUnit?

64 views Asked by At

I am trying to set authentication parameters in httpUnit. The URL that I want to access can only be accessed when authentication parameters are set otherwise it returns

Internal server error 500

But its not working when I tried to set parameters

The code I am using to set authentication using httpUnit is given below

WebConversation wc = new WebConversation();

WebRequest request2 = new PostMethodWebRequest("");   //url comes here

wc.setAuthentication("UserDatabaseRealm", "username", "password");

I am getting internal server error 500 as it is not accepting the authentication credentials.

It would be really greatful if someone could help me out in this. Thank you

0

There are 0 answers